For this week’s Tech Talk Friday, I presented a live demo of authenticating with Twitter using OAUTH. The presentation covered a number of basic steps and source code to get yourself up and running with a working copy in no time.
Below is a quick outline of exactly what is included and accomplished in the downloadable demo:
- Twitter authentication with OAUTH.
- A wrapper library containing generic methods for handling authentication, callbacks, and a few API calls.
- Documentation and comments in all source files.
- A fully functional page of API call examples with AJAX, including:
- The ability to tweet from the web application after logging in.
- Generation of a user list timeline. AJAX handling on the page will poll for updates every minute using the id_str return value to pass as the since_id param in the subsequent poll.
- The ability to follow a user directly from the timeline.
- A links page referencing important Twitter documentation pages regarding API integration.
The polling functionality is a good demonstration of using Twitter’s new since_id parameter to grab newer results. Proper usage of id_str field is also used. This basically means that there won’t be any signed integer problems with the new lengthy tweet ids generated by Snowflake.