Posted by & filed under NetMusician, PHP/CodeIgniter.

We are pleased to release our first, and likely not last CodeIgniter Spark called, simply, “TwitterFetcher”

We are pleased to release our first, and likely not last CodeIgniter Spark “TwitterFetcher”. TwitterFetcher fetches Twitter data via the provided Twitter username, and supports the following options:

  • specify how many tweets to fetch
  • specify whether tweets should be returned as JSON or XML data
  • an optional cache file which allows local retrieval of tweets to reduce the number of outbound Twitter connections being made by your site
  • a “cacheduration” parameter which dictates how often this cache file should be regenerated
  • specify whether Twitter links embedded in tweets should be automatically formatted into clickable links
  • support for multiple Twitter feeds
  • a human friendly “created at” string that is attached to the object returned in the format of “minutes/days/hours ago”, seen frequently on various sites that display recent tweets
  • set a cutoff number of days to fetch tweets for

Information on installing and using this Spark can be found here. The Github repository for this code can be found here.

For those of you not familiar with CodeIgniter Sparks, CodeIgniter Sparks are simply third-party CodeIgniter libraries that can be downloaded via the Sparks download manager and integrated into any existing CodeIgniter project (providing the Spark is compatible with the version of CodeIgniter you are using, which is ascertained by the Sparks download manager). This open source project is new, but appears to be quite promising and a great idea, we think! This Spark was built depending on the existing RestClient and Curl Spark, so already the philosophy behind this project in providing a means to share CodeIgniter code and in doing so reduce development time appears to have paid off!