Connecting to twitter

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Connecting to twitter

Sam Neaves
Hello,

I would like to try and connect to twitter with prolog.
I am a beginner when it comes to API's so please bear with me.

I imagine using something like:

 http_get('
https://api.twitter.com/1.1/statuses/mentions_timeline.json?count=10',Reply,
[]).

Where reply would be a Json term which I could then convert to normal
prolog terms with *json_to_prolog*(+JSON, _Prolog)

I am having trouble understanding the Oauth requirements of twitter. I
understand I have to create an app on twitter and this will give me various
keys and access token secrets. I imagine I would use these to build up a
string which I would pass to a term like http_get or http_post.

I have successfully used a python library to retrieve tweets but the
details of what is happening in the background are hidden.

Any help/ explanations would be appreciated.
-------------- next part --------------
HTML attachment scrubbed and removed
_______________________________________________
SWI-Prolog mailing list
[hidden email]
https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
Reply | Threaded
Open this post in threaded view
|

Re: Connecting to twitter

Michael Hendricks
On Fri, Jul 11, 2014 at 8:21 AM, Sam Neaves <[hidden email]> wrote:

> I am having trouble understanding the Oauth requirements of twitter.


It's unfortunate that so many websites rely solely on OAuth these days.  It
makes it much more complicated for small programs.

My first recommendation would be to use foauth.org  You interact with their
free service via basic HTTP authentication.  They handle all the OAuth
details behind the scenes.

I also have some really ugly OAuth code in
https://github.com/mndrix/tomorrow/blob/master/prolog/tomorrow.pl#L244
 Perhaps that will help if foauth doesn't meet your requirements.

Good luck.

--
Michael
-------------- next part --------------
HTML attachment scrubbed and removed
_______________________________________________
SWI-Prolog mailing list
[hidden email]
https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog