Naturally, each stream type can/should be subclassed appropriately to let developers consume the stream type, ie:$myPublicStream = new Phirehose(Phirehose::METHOD_SAMPLE);$myUserStream = new UserStreamPhirehose(...);$mySiteStream = new SiteStreamPhirehose(...);
So, 3 questions:class MyFunkyWebsiteStream extends SiteStreamPhirehose {...}$myStream = new MyFunkyWebsiteStream();$myStream->consume();
--
Adam Green, 140...@gmail.com
Twitter API Consultant and Analyst
Developer of the First Presidential Twitter Debate
http://140TownHall.com
http://140dev.com, @140dev
http://2012twit.com, @2012twit
781-879-2960
I agree with the suggested roadmap. I'd add more detailed documentation and
samples for beginners. I could help with that.
As for the linkifier needed by Adam, here's the function I use for the task.
Notices two things:
- you need to have PCRE compiled with full unicode support
- In my service I include in hashtags more characters than the officially
supported. Adjust the regexp to your needs.
/**
linkify function with support for utf-8 characters.
@param $text is the raw text of the tweet
@returns the same tweet with links, users and hashtags linkified
warning: you need to have PCRE compiled with "Unicode properties support"
run pcretest -C on your console. the result should include this lines:
Compiled with
UTF-8 support
Unicode properties support
*/
function procesaTwit($text) {
return preg_replace(array(
'@(https?://([-\w\.]+)+(/([\w/_\.\-]*(\?\S+)?(#\S+)?)?)?)@',
'/@(\w+)/',
'/#([\d\w\/\pL]+)/',
),
array( '<a href="$1" target="_blank">$1</a>',
'<a href="http://twitter.com/$1">@$1</a>'
'<a
href="http://twitter.com/#!/search?q=%23$1">#$1</a>'
),
$text);
}
ff