Total newbie - how to?

1 view
Skip to first unread message

Nathan

unread,
Jun 11, 2009, 6:42:45 AM6/11/09
to Tipjoy Developers
Ok, let's try different approach. I have this:

http://tipjoy.com/api/getTransactions/?url=http://example.com?id=123

As far as I understand, it can be used to find out if transaction with
url http://example.com?id=123 has been made. It will return me JSON
data, so far so good. But that's all I understand.

I have url, but what do I do with it? I would like to click a button
("a" link, or any "submit" button in classic html form) to check if
the transaction exist, and then return true or false (and I'm talking
about PHP here)?

Ivan Kirigin

unread,
Jun 11, 2009, 1:13:14 PM6/11/09
to tipjoy-d...@googlegroups.com
The button could use javascript on the client side or PHP on the
server side to hit our API and return the data. It would need to be
parsed to determin the number and value of the transactions.

That data would then be written to the page in javascript, or returned
from your server side.

I personally find the complexities of cross domain javascript (i'm a
JS newb) annoying, and so proxied those requests from my server side
when making tatatweet.com

Here is an example to get the user's balance
http://github.com/ikirigin/tatatweet/blob/3b22bd0962a9eb280ff41ab03975ee84771bff96/tipjoy/views.py#L12

Here is an example to check for transactions initiated by the user
(and not by tatatweet). That would be equivalent to checking for
transactions for a url
http://github.com/ikirigin/tatatweet/blob/3b22bd0962a9eb280ff41ab03975ee84771bff96/tipjoy/models.py#L173

Ivan
http://tipjoy.com

Nathan

unread,
Jun 12, 2009, 5:54:58 AM6/12/09
to Tipjoy Developers
Honestly I really don't need python code each time I post a question,
because I'm not familiar with python in any way and it won't help me
in any way either.

What I need is a "dummy guide" - if I can use PHP, then what specific
class/function should I use, same to JS - what library/class/function
should I use, because I don't even know what should I type in google.

Not everyone is a rockstar python coder, and if you will keep posting
useless python codes all the time instead of explaining people at
least what they should look for, then trust me - your API will be
useless for few more months until someone will be kind enough to
explain "what the heck" on some blog.

On Jun 11, 7:13 pm, Ivan Kirigin <ivan.kiri...@gmail.com> wrote:
> The button could use javascript on the client side or PHP on the
> server side to hit our API and return the data. It would need to be
> parsed to determin the number and value of the transactions.
>
> That data would then be written to the page in javascript, or returned
> from your server side.
>
> I personally find the complexities of cross domain javascript (i'm a
> JS newb) annoying, and so proxied those requests from my server side
> when making tatatweet.com
>
> Here is an example to get the user's balancehttp://github.com/ikirigin/tatatweet/blob/3b22bd0962a9eb280ff41ab0397...
>
> Here is an example to check for transactions initiated by the user
> (and not by tatatweet). That would be equivalent to checking for
> transactions for a urlhttp://github.com/ikirigin/tatatweet/blob/3b22bd0962a9eb280ff41ab0397...
>
> Ivanhttp://tipjoy.com
>
> On Thu, Jun 11, 2009 at 3:42 AM, Nathan<wojciech.usarzew...@gmail.com> wrote:
>
> > Ok, let's try different approach. I have this:
>
> >http://tipjoy.com/api/getTransactions/?url=http://example.com?id=123
>
> > As far as I understand, it can be used to find out if transaction with
> > urlhttp://example.com?id=123has been made. It will return me JSON

Ivan Kirigin

unread,
Jun 12, 2009, 9:48:13 AM6/12/09
to tipjoy-d...@googlegroups.com
Hi Nathan,

I suggest you learn python, not for our API, but because it is a fine
language. I've learned a lot of languages, and python is by far the
easiest to read, write, and share. Obviously, this is just my opinion.

We do hope to have open source example applications in other web
frameworks and languages. But we're a bit resource constrained right
now, so we're going to have to rely on someone nice on this list, or
you're going to have to pay for developers.

Ivan
http://tipjoy.com

dinosaur robot

unread,
Jun 12, 2009, 2:00:13 PM6/12/09
to tipjoy-d...@googlegroups.com
Nathan,

It sounds like you understand using the TipJoy API and receiving JSON,
but are unsure how to make the HttpXmlRequest? This doesn't sound
TipJoy specific, and in fact I bet you'll have better luck asking a
large php or javascript forum for help than this small community.
Please rephrase your question if I've misunderstood.

I don't know php, so I tried googling "php twitter library". I found this post:
http://devzone.zend.com/article/4431

The code walks through the html and php for interacting with twitter.

The code that you really want, though, is abstracted by the PEAR
library, which you can download and read from their site:
http://pear.php.net/package/Services_Twitter

Using the TipJoy API is very similar to using Twitter's API...it's
just a different URL, but it's the same POST/GET -> JSON data flow.

Do report back if you modify PEAR to work with TipJoy-- that would be
an awesome contribution to a sprouting community.

Hope that helps,
Lucy.
ps - I have to agree with Ivan. If you can figure out php, then you
practically already know python/javascript. They're so much friendlier
for us lazy bums who like things simple and straightforward and with
lots of helpful libraries ;-)
Check out jQuery for a sweet javascript library that makes doing ajax
fairly painless.

Nathan

unread,
Jun 13, 2009, 2:27:03 AM6/13/09
to Tipjoy Developers
Finally! Thank you Lucy, now I have the "hook" and I know how to grab
it, so now I can go in peace and learn something new :).

Thank you again very much!
> On Fri, Jun 12, 2009 at 9:48 AM, Ivan Kirigin<ivan.kiri...@gmail.com> wrote:
>
> > Hi Nathan,
>
> > I suggest you learn python, not for our API, but because it is a fine
> > language. I've learned a lot of languages, and python is by far the
> > easiest to read, write, and share. Obviously, this is just my opinion.
>
> > We do hope to have open source example applications in other web
> > frameworks and languages. But we're a bit resource constrained right
> > now, so we're going to have to rely on someone nice on this list, or
> > you're going to have to pay for developers.
>
> > Ivan
> >http://tipjoy.com
>
> >>> > urlhttp://example.com?id=123hasbeen made. It will return me JSON

Nathan

unread,
Jun 16, 2009, 8:45:49 AM6/16/09
to Tipjoy Developers
Good news - I now understand how to use cURL and json_decode to parse
API responses, and I have begun work on PHP class to manage TipJoy
API. After 2 hours of work, my class is capable of checking if user
exist, and if transaction for specific url exist. Few more days and I
hope to publish first release, yay!
> > >>> > urlhttp://example.com?id=123hasbeenmade. It will return me JSON

dinosaur robot

unread,
Jun 16, 2009, 9:33:05 AM6/16/09
to tipjoy-d...@googlegroups.com
Nathan,

Heck yeah!!!

Lucy.
Reply all
Reply to author
Forward
0 new messages