Hey guys, So recently after a few talks with some of the folks on twitter alot of guys and girls have been asking me how I managed to save all my tweets into a MySQL database relatively quickly.

Now just to clear some of the things that have been already said, The reason I’m using PHP to pull the tweets and not Javascript is as follows, When Twitter gets overloaded and Mr fail whale makes an apprance (which commonly happens) then the tweets on my website have been known to disapear, not only do they disapear but when they are loaded in via Javascript the search engines don’t class this as content thats “on the page” thus it makes no help to my SEO content. Afterall we all like what we say to actually be productive to our sites right? So thats the reasons why I quickly coded up this script.
If you look closey you can see it working on the right hand side of this site. I was also going to release a tutorial on how to do it with a step by step of what each line in the PHP does, but instead of doing a write-up which would be probably been more beneficial for most, I’ve decided to just release the code as a script under the GPL (V3) and then you all can do what you like with it.
Keep in mind that it’s by no means “polished” and there are alot of other better ways to do this, but for those who are interested or just want a quick way to get your tweets from twitter into your own personal MySQL database for archiving then feel free to use this.
Download Tweet2MySQL Here.
Filename : Tweet2MySQL-0.1.zip | Version 0.1 | Download Size 18Kb
Permlink : Tweet2MySQL-0.1 (346) Downloads






Miguel says:
Hey! I was taking a look through the code and it looks great! The only problem I have is with pushing the tweets to the MySQL database. Everything works great, I get a successful connection to the database (I’ve tested it), but for some reason, no tweets stored on the database. Any ideas? Thanks!
Nov 02, 2012, 3:27 pmDan Cunningham says:
Hi Miguel,
Unfortunately Twitter have updated their code, and this has stopped my script from working.
The good news is, I’ve got a update coming that will fix this for you.
I’ll post it up once it’s finished.
Cheers
Nov 16, 2012, 2:21 amDan.
Jose A says:
Hi Dan, you finished the new script? you post it up?
Cheers
May 05, 2013, 4:36 pmJose A.