[Rack] PHP PEAR classes for Twitter support on pony.noise

Benny Baumann BenBE1987 at gmx.net
Tue Nov 23 02:28:23 PST 2010


Hi everyone,

I was asked by rubin to write in on the list for two projects I'm
working on ATM, one being the REBar, the other a small hack for the Door
Opening, both involving Twitter and the Twitter API (accessed from PHP
code).

But as the latter currently is limited to personal use (source
published, but set up to only work for me currently, I'll skip this one
for now (I'll discuss this one in another thread as the subject for the
Door project has some other implications).

For now I'd like to announce a bit of work I'd like to do on the REBar,
that involves improving the caching of Twitter API responses (done
today, caches results for 5 minutes) and cleaning up the code that is
making external HTTP downloads using CURL (file_get_contents does a
quite nice job in most cases and looks cleaner, not done yet).

What I'm now coming at is: Since both projects involve Twitter it would
be nice to avoid recoding all the Twitter API bindings for every
plugin/widget but instead use the Services_Twitter binding provided by
PEAR, a well-known class library for PHP, which provides a binding for
Twitter including OAuth authentication which is required to take
advantage of higher rate limits on API access.

I use both the Twitter and OAuth classes in projects of my own and a
check of the source revealed quite good coding and (as far as I saw when
skimming over it) _no obvious_ flaws or security breaches.

I'm looking forward to your input on the issue of installing the PEAR
classes Services_Twitter and HTTP_OAuth on pony or not.

Advantages:
- Cleans up existing code if used
- Easy OOP usage
- Avoids parsing in user code (responses are preparsed and filtered)
- Widely used repository of code with good coverage regarding quality
checks
- Solid codebase
- Rapid developement (few LOC with big effect)

Disadvantages:
- Introduces more code to check in security audits
- Documentation on how to use those classes derives from the Twitter API
docs, not the source docs of those classes ("runtime typed"). Though
there's an XML file describing all the allowed functions/properties.

Any constructive input welcome.

Best regards,
BenBE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://www.noisebridge.net/pipermail/rack/attachments/20101123/4c1969e5/attachment.pgp 


More information about the Rack mailing list