Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2012-06

OAuthv1/Twitter library/application ready; was: EncodeURLElement, underscore and RFC3986?

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Reinier Olislagers

(Cross-posted to Synapse and FPC mailing lists)

> On 11-6-2012 16:38, Lukas Gebauer wrote: >> BTW: OAuth library will be interesting, feel free to inform here >> about it.

I've finished a basic Twitter application and OAuth v1 library under an MIT license (happy to relicense under the Synapse license).

Code can be downloaded using Mercurial or as a zip from https://bitbucket.org/reiniero/fpctwit/

While not perfect yet, the application demonstrates:
- Authenticating to Twitter using existing credentials (ConsumerKey, ConsumerSecret, Auth_token, Auth_secret)
- Authenticating to Twitter using Out Of Band/PIN authentication using a callback in the application that sends the user to an URL. User authorizes application and gets a PIN which he enters in the application.
- Reading public and own timeline
- Parsing tweets from JSON data
- Tweeting a message
- Showing all tweets that come through the streaming API

Currently only run on Windows; it will be probably need some tweaks for line ending issues on Linux/OSX.
Built for FPC (on 2.6.1); don't know how hard it would be to port this to Delphi.

Comments and improvements to the code are always welcome - I'm not a programming guru, but got this done with some help... ;)

To implement streaming support (Twitter sends a stream of tweets inside a single HTTP response), I had to modify Synapse httpsend to be able to override ReadUnknown (see patch). I'd be very happy if that patch could be applied.
Added as Feature Request 3536896 [Patch] Allow httpsend.Readunknown override in SourceForge with the same patch as attachment.

Thanks,
Reinier

Reply by email

Marcos Douglas
to Reinier Olislagers
Reinier Olislagers wrote 40 lines
(Cross-posted to Synapse and FPC mailing lists) >> On 11-6-2012 16:38, Lukas Gebauer wrote: >>> BTW: OAuth library will be interesting, feel free to inform here >>> about it. I've finished a basic Twitter application and OAuth v1 library under an MIT license (happy to relicense under the Synapse license). Code can be downloaded using Mercurial or as a zip from https://bitbucket.org/reiniero/fpctwit/ While not perfect yet, the application demonstrates: - Authenticating to Twitter using existing credentials (ConsumerKey, ConsumerSecret, Auth_token, Auth_secret) - Authenticating to Twitter using Out Of Band/PIN authentication using a callback in the application that sends the user to an URL. User authorizes application and gets a PIN which he enters in the application. - Reading public and own timeline - Parsing tweets from JSON data - Tweeting a message - Showing all tweets that come through the streaming API Currently only run on Windows; it will be probably need some tweaks for line ending issues on Linux/OSX. Built for FPC (on 2.6.1); don't know how hard it would be to port this to Delphi. Comments and improvements to the code are always welcome - I'm not a programming guru, but got this done with some help... ;) To implement streaming support (Twitter sends a stream of tweets inside a single HTTP response), I had to modify Synapse httpsend to be able to override ReadUnknown (see patch). I'd be very happy if that patch could be applied. Added as Feature Request 3536896 [Patch] Allow httpsend.Readunknown override in SourceForge with the same patch as attachment. Thanks, Reinier

Hi,
First, good job.

I can't clone the sources:
$ git clone https://bitbucket.org/reiniero/fpctwit Cloning into fpctwit...
fatal: https://bitbucket.org/reiniero/fpctwit/info/refs not found: did you run git update-server-info on the server?

I'm using Windows too.

Marcos Douglas

Reply by email

Graeme Geldenhuys
to Marcos Douglas
Marcos Douglas wrote 7 lines
I can't clone the sources: $ git clone https://bitbucket.org/reiniero/fpctwit Cloning into fpctwit... fatal: https://bitbucket.org/reiniero/fpctwit/info/refs not found: did you run git update-server-info on the server?

He did say he was using a mercurial repository, not a git one.

Regards,
Graeme

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Marcos Douglas
to Graeme Geldenhuys
Graeme Geldenhuys wrote 17 lines
On Thursday, 21 June 2012, Marcos Douglas wrote: > > > I can't clone the sources: > $ git clone https://bitbucket.org/reiniero/fpctwit > Cloning into fpctwit... > fatal: https://bitbucket.org/reiniero/fpctwit/info/refs not found: did > you run git update-server-info on the server? He did say he was using a mercurial repository, not a git one. Regards,   Graeme

Oh... right. Sorry.
Thanks Graeme.

Marcos Douglas

Reply by email