37 points · by abraham · 16y ago · 25 comments
What makes me qualified to answer Twitter API questions? I am the all time top poster on the developer group: http://groups.google.com/group/twitter-development-talk/about and my TwitterOAuth library is the 4th most watched PHP repo on GitHub: https://github.com/languages/PHP
Edit: Feel free to contact me through other means as well: the@abrah.am or @abraham
The ugly way a coworker and I ended up using was to just see if the single tweet was in response to an ID, request that ID, see if that was in response to an ID, and so on until it either ended or we cut it off prematurely after a certain conversation length. This method also doesn't allow you to see any future messages within that conversation.
You could also use the third-party API that Twitoaster provides. Twitoaster will generally only work if the user who created tweet that started the conversation is a Twitoaster user.
[1] http://app.apigee.com/console/apigee-console-snapshots-12833... [2] http://twitoaster.com/api/
[1] http://dev.twitter.com/pages/rate-limiting#rest [2] http://dev.twitter.com/pages/oauth_single_token
At the moment, the blog titles are formatted by EE's own Markdown - the difference between it and Markdown is that em-dashes are made with "--".
I could use a service that retrieves the RSS information about the blog titles and post their formatted versions (with proper curly quotes, dashes, etc.), but I prefer to manage everything myself.
My question is, what is generally the way to write a Twitter bot for a blog that publishes the post title and (shorturl) link similar to what @daringfireball does, and how do I preserve the formatted title text?
Complete Twitter API novice, but I've been trying to get into doing some projects with it, but the available resources haven't helped me much.
Thanks a bunch for offering your help to everyone at HN.
1) This is EE specific and I know nothing about EE so you are on you own.
2) You can roll your own URL shortener if you want or use one with an API like http://bit.ly. http://code.google.com/p/bitly-api/wiki/ApiDocumentation
3) Format the title however you want. Probably by taking the pre-formated title text, running it through EE's Markdown function, and concatenating the shortened URL to the end.
4) Finally a POST request to Twitter to create the status: http://dev.twitter.com/doc/post/statuses/update. For this I recommend finding a OAuth library for EE as rolling your own will take time and likely won't conform the the OAuth specification. Since it will be a single account there is a shortcut to getting access tokens for the account: http://dev.twitter.com/pages/oauth_single_token.
For failed API calls that return a 200 status code validate the response. For example if you are getting a user then verify that there is a screen_name and id present. If they are present in the response you are fairly safe to assume the call actually succeeded.
Are you seriously checking for failwhale's image name in API response?
http://groups.google.com/group/twitter-development-talk/msg/...
I have an app that pulls data from the Twitter streaming API, filtering on a keyword. Suppose, I start getting rate-limited errors (I guess any response code other than 200, means that you are getting rate limited).
Can I still keep pinging Twitter - and when the 60 minutes are up, will the tweets start coming in again ? Or can I sleep for exactly 65 minutes and hope that everything will be fine again ?
If you are getting a response other then 200 check for the coresponding reason on Twitter's list [2].
[1] http://dev.twitter.com/pages/streaming_api_concepts#filter-l... [2] http://dev.twitter.com/pages/streaming_api_response_codes