In my last tutorial, I’ve touched on how to use the to.ly API and how to make automatic “Tweet it” buttons with a relevant message.
Well, this can get problematic if with every page refresh, your server sends out a request to the to.ly server for a short link. Pretty soon, you’ll be getting “Too Many Connections” and you’re screwed. Just like I was, so here’s an idea. How about we store those links in a database….automatically?

You see, it’s much easier to create a script that will request a shortlink, adds the link to the database, and then just call it up whenever you need it. It works perfectly well on my quote site. Basically, whenever you create a website with get-requests, tons of pages, and all that. You can use the following script to make it all work, automatically (again).


More >