Twitter and SD News
On the suggestion of my friend Nathan Bingham, I recently added some cool Twitter functionality to SD News.
I added a page to the administrative backend that shows all the items that have been submitted in the last 48 hours, along with how many votes they have received. The admin (me) can then add whichever items he chooses to a queue. There is a cron script that runs once an hour, that takes one item from that queue and sends it to Twitter. Simple. I have already sent three links to Twitter and got 13 visitors; not bad considering sdpub only has 24 followers as of today. The two gems I used, which I recommend for their simplicity, are Ruby Twitter and bitly, which I used to shorten the urls. Submitting the items to Twitter was easy:I made sure to save the bit.ly url so that I could look up the stats later: This leaves me with a Hash, @stats, the key being the item id. I then made a simple view to see how many clicks each item received (referencing @stats[item_id]["clicks"]). All in all a simple addition to SD News that I hope will pay off. Thanks again Nathan!
Comments [0]