Download Twitter Followers

Ever wanted to download followers from somebody’s Twitter account in a basic list format? I recently made one that does just that. Its pretty easy to use too (has some jQuery to have a better interface).

Download Twitter Follower PHP Script

Note: This is just a quick version of the script, not really tested in secure environments or anything. Expect the script to break if you don’t type in a real screen name, watch your API call limits, or if you don’t have a valid authentication login.

Instructions

  1. Download, Extract, Upload to Web Server
  2. Edit get.php (username and password)
  3. http://path.to/script
  4. Type in a valid screen name and you’re good to go

There are limitations to this such as the Twitter API calling limit. You can only follow so many people before the script breaks unless your IP or account is whitelisted. You might think..well okay the API call limit per hour is 150, that means I can search 150 screen names in 1 hour, that’s not bad at all. WRONG. The program can only grab 100 followers per call, so say I wanted to grab an account with 1000 followers, it will take 10 API calls to grab all 1000 followers. If you wanted to grab 10 accounts with 1000 followers…well you can do the math. 15 Accounts per hour with that situation is inefficient. Getting an account whitelisted can help ya overcome that limit.

For a more professional version of this script with more features, contact me and I will give you a quote. It’s good having such a feature on your site, it’ll help you market your business or website better with millions of twitter accounts recorded on your database.

Download links, without the source file

Now this “hiding the source file” may seem irreverent but it can definitely help you out when it comes to tracking your downloads, seeing who’s downloading them, and file management. These are essential for any web developer because you want all the content on your site to be tracked and analyzed (not just the site itself). SEO professionals can provide their clients ways to track their site efficiently but can they track the downloads too? CMS systems provide ways to do that but what about custom made sites or blogs (like wordpress)? How can site owners know if the downloads they post on their site are even an importance to the audience they try to attract?

The first goal is to start making the downloads.php file. Its pretty simple.
This is directly from http://us3.php.net/header

1
2
3
4
5
6
7
8
9
10
<?php
// We'll be outputting a PDF
header('Content-type: application/pdf');
 
// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="downloaded.pdf"');
 
// The PDF source is in original.pdf
readfile('original.pdf');
?>

Pretty easy right? Its setting the page type to be a direct download to “downloaded.pdf” and readfile(); is showing the original path to the file. Already the source of your file is hidden. I prefer the sources to be hidden just for peace of mind. Lets see how we can track it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
// made up class
include("class.trackdownloads.php");
 
$download = new trackdownloads();
// some features you can add to your site
$download->get_host();
$download->add_one_to_number_of_downloads();
$download->check_for_refer_link();
$download->check_if_user_downloaded_file_more_than_once();
 
// We'll be outputting a PDF
header('Content-type: application/pdf');
 
// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="downloaded.pdf"');
 
// The PDF source is in original.pdf
readfile('original.pdf');
?>

As you see, there are numerous possibilities that you can do when you manually code your downloads rather than just uploading them to the FTP and giving out the direct link to whomever you need to give it out to. Anyone who wants me to create a working class please comment back with ideas in what the program should do.