Introducing the Twitter Watch

The Watch is a list of curated quality links about web development. I've been maintaining it for a year now so I thought I would share the results with everyone as this will probably be useful to somebody else. I select the links from Twitter mostly based on their usefulness. They contain interesting reads, points of views, helpful scripts, articles, resources... Well plenty of things worth bookmarking when you are interested in web development.

Thank You for Downloading

I'm glad that you found my work useful. If you did, it might help some other people too. So why not helping me spread the word with a tweet? You could also buy me a coffee to thank me for my code and explanations if you prefer ;).
I hope you'll enjoy your download. Regards. Jeremy.

Visit the Watch page

A bit of history

In my previous site version, I used to post a monthly list of useful web development links found on Twitter. It was interesting but a bit tedious to maintain because I needed to get a picture of the link, write a short description (in two languages at the time), and post it in a particular administration module.

I realized this workflow wasn't ideal so I imagine an automated solution that would encourage me to tweet quality links that would automatically be saved in my module if they contained a url and a hashtag.

I already have a script that displays my latest tweets at the bottom of the site. I imagined taking this further to analyze the tweet and given they meet some particular requirements, save them in the database automatically.

How does it work?

I wrote a tweet analyser class in php. Its role would be to look for links, hashtags and usernames in a given tweet first, then if some of those elements are found, perform a given action with the tweet, the default action being a simple backup of the tweet in the database.

In more details

Run the analyzer on the tweet

  1. include_once(WP_THEME_ROOT.'/models/tweetAnalyser.class.php');
  2. $analyser = new tweetAnalyser();
  3. $analyser->analyseTweet($tweet); //$tweet being a tweet object returned by an API call

Analyze the tweet

  1. public function analyseTweet($tweet){
  2. $text = $tweet->text;
  3. $smart = array();
  4.  
  5. //get links
  6. $linksmatches=array();
  7. preg_match_all('#http://[a-z0-9._/-]+#i', $text, $linksmatches); //Links
  8. $smart['links'] = reset($linksmatches);
  9.  
  10. //get users
  11. $usernamesmatches=array();
  12. preg_match_all('#@([a-z0-9_]+)#i', $text, $usernamesmatches); //usernames
  13. $smart['usernames'] = reset($usernamesmatches);
  14.  
  15. //get hashtags
  16. $htagsmatches=array();
  17. preg_match_all('#\#([a-z0-9_-]+)#i', $text, $htagsmatches); //Hashtags
  18. $smart['htags'] = reset($htagsmatches);
  19.  
  20. $this->bk($tweet,$smart);
  21. }

Save the tweet

  1. public function bk($tweet,$smart){
  2. //Save the tweet in database
  3. }

We can then imagine plenty of outcomes from a class like this. For example, instead of just saving the tweet in the database, we could imagine saving it to delicious or reddit, send an email to someone, post it automatically to another twitter account, @reply to someone, post an image to instagram or flickr and so on! The ifttt service offers plenty of similar functionalities for example or inspiration, but the good thing with a custom script is that it allows you to integrate it better with your own system.

As an example, with my saved tweets, Iv've built the Watch page, that allows me to keep track of my tweeted links. I've also indexed those links so they can be searched via my site's search engine. Therefore, when I recall having seen a nice links about grunt but don't remember what the url was, I just use my site's search and it gives me everything I need.

So what are you going to do with your tweets? Let me know in the comments.

Leave a Reply

Your email address will not be published. Required fields are marked *

Other Useful Resources

How to integrate the new Twitter api (1.1) in php illustration

On October 11th 2012, Twitter introduced some major changes in its API following its plans to clean things up deeply. As is explaining the twitterapi account they have for example shut down or limited access to some of their data and resources. So if you've noticed that some Twitter functionalities you are using on your site are not working any more, you may have to check a few things. In this article written on NOE interactive's blog, you'll learn what has concretely changed, and you'll be able to follow a few steps to get your Twitter feeds back.

Read more
jQuery FancyBox plugin illustration

The FancyBox is one of the plugin that I like the most. It's so easy to use and renders really nicely, especially with images. It's a Mac like zooming tool that you can customize quite well and really looks amazing. Source and © Janis Skarnelis

Read more
How to integrate your instagram pictures with php illustration

Ever looked for a straightforward way to integrate you instagram pictures on your website? Without a plugin nor an iframe? Well this article featured on the NOE interactive's blog presents how you can do so with PHP.

It's a neat and simple solution that uses the instagram's API to get a particular users' latest pictures, and then display them in a ul list.

It is accessible to most developers as it is a "personalize, copy and paste" kind of solution. Just two steps are required, configuration, and implementation.

In this article featured on NOE interactive, you'll learn how you can install the solution on your website. There's a complete step by step guide as well as a demonstration. If you wish to download the solution, it's also hosted on Github.

Read more
@Jerek0 Ha ha sympa JM. C’éta comment ?26 May / 09:20