How to get Twitter follower count in PHP

Are you are WordPress developer and want to show twitter follower count on your wordpress blog or you want to show your Twitter follower count on your PHP based site? You might be wondering how to get that number from twitter. So here is the code snippet with details so you can write your own or you can just copy paste this one.

The new Twitter API allows you to read user information in XML and JSON format, so all you have to do is get the information in XML format and read the value between <followers_count> element.

Here is the code snippet for reading twitter followers count in PHP.

<?php
 
$username = "hameedullah";    // Set this to username whose follower count you want to read.
 
$twitter_api_url = "http://api.twitter.com/1/users/show.xml?screen_name=$username";
 
$api = curl_init($twitter_api_url);
curl_setopt($api, CURLOPT_HEADER, 0);
curl_setopt($api, CURLOPT_RETURNTRANSFER, 1);
$xml = curl_exec($api);
curl_close($api);
 
if (preg_match('/followers_count>(.*)</',$xml,$match)!=0) {
    $followers_count = $match[1];
}
 
echo $followers_count;
?>

If you have any issues with the code snippet let me know in comments, or if you are looking for a code to get something else from the Twitter API let me know in comments too.

How to blog like a pro?

Blogging like a pro is the wish of every blogger. If you are a blogger or you want to start blogging you will definitely want to blog like a pro. Zemanta is the service that lets you blog like a pro by helping you find the related images, articles and videos to your posts.

Zemanta provides browser addons for almost all the browsers out there. All you have to do is just install the addon and goto your blog admin panel (I have tested with WordPress 3.0.2 but it works with all blogging platforms). As soon as you will goto the “Add New Post” i.e post editor of your blog you will find a new panel “Content Recommendations” on the right hand side of the editor.

Using Zemanta is as easy as 1, 2, 3. Below are the steps:

Step 1: Start writing your blog post.

Step 2: Zemanta will find the related content and show them to you in the Content Recommendation box.

Step 3: Add the images, videos, links from Zemanta recommendations to your blog by dragging them or click them.

Zemanta Blogging Steps

Here is how it looked while writing this post.

Zemanta Blog Post

Zemanta will not work with the post editor in HTML mode, you will need to switch to Visual editor to be able to use Zemanta.

Zemanta Visual Editor

What methods you use to find the related content to your post? Do you think Zemanta will help boost the blogging experience for bloggers? Write a comment to let us know your views.

WordPress 3.0.2 is available for download.

WordPress 3.0.2 has been released couple of days ago. The release fixes a security issue and some other bugs.

The security issue in the older versions of wordpress could allow author level users to gain further access on the blog. But even if you don’t have other users on your blog you should upgrade your blog to the latest version.

If your theme does not support the newer versions of wordpress you can hire me or any other wordpress developer to make your theme and plugins compatible with newer version of wordpress. But do not delay the update as you might later regret it and will have to hire someone to not only update your theme but also fixed your hacked blog or in worse case you might even lose all your precious data on your blog.

You can update automatically using the WordPress Dashboard of your blog or you can download the update and then do the manual upload. Once again if you are worried about breaking your blog you can hire me.

P.S I will soon write the step by step howto to update your wordpress installation to the latest version without breaking the blog.

Yet another reduction in Amazon S3 prices.

Amazon has decreased S3 prices yet again. This is one of the benefits of cloud storage that the price to store your data is never fixed, but it will always go down because of the competition and newer and effective methods of storage.

With Amazon S3 it’s not only the benefit of price reduction in storage but you also get reliable delivery of your data to your users and versioning support for your critical data.

The new price list is as follows:

First 1TB is $0.140 per GB
Next 49TB is $0.125 per GB
Next 450TB is $0.110 per GB
Next 500TB is $0.095 per GB
Next 4000TB is $0.080 per GB
Over 5000TB is $0.055 per GB

The prices for reduced redundancy storage are all 1/3 of standard storage so they are automatically reduced too. The new pricing for reduced redundancy storage are as follows:

First 1TB is $0.093 per GB
Next 49TB is $0.083 per GB
Next 450TB is $0.073 per GB
Next 500TB is $0.063 per GB
Next 4000TB is $0.053 per GB
Over 5000TB is $0.037 per GB

According to the Amazon Web Services Blog post there will be more new announcements in near future so stay tuned for more good new from S3 team.

Note: I have wrote this post using WordPress for iPad only the thumbnail is being set using the WordPress admin panel.

Jailbreak iPad running iPhoneOS 3.2.2 with Limera1n

Limera1n is the new jailbreaking tool released by geoh0t. Geoh0t had been working on this tool for quiet a long time and according to him this tool can jailbreak any version of iPhoneOS and iOS. You can jailbreak your latest iPad running the latest update of the firmware using this tool. Just follow the below steps and it will take you only 1-2 minutes to complete the whole process. If you are wondering why I am writing this howto now, because I just jailbreaked my iPad with limera1n.

Step 1: Update your iPad to latest firmware i.e iPhone OS 3.2.2 if you have not already. If you have bought the iPad recently it must already have the latest.

Step 2: Download limera1n from http://www.limera1n.com/

Step 3: Connect your iPad to your computer via USB cable, make sure to close iTunes when it is launched upon connecting the iPad.

Step 4: Launch the limera1n on your computer and click the “Make it rain” button. and then keep an eye on the limera1n window on your computer.

Step 5: Limera1n will instruct you to hold the Home+Power button, press both the buttons simultaneously.

Step 6: After few seconds limera1n will instruct you to release the power button, keep the home button pressed but release the power button.

Step 7: Then limera1n will show you that the device is in DFU mode.. and soon the limera1n icon will appear on your iPad screen during which limera1n will perform the exploit on the device.

Step 8: As soon as the limera1n performs the exploit on the device the iPad will shutdown and limera1n will show you the “Done” message on your computer screen.

Step 9: Boot your iPad and then click on the limera1n app in your iPad.

Step 10: Select the Cydia package and click Install.

Enjoy your new jailbroken iPad with latest iPhone OS 3.2.2

WordPress 3.0 has been released

Finally long awaited version 3.0 of WordPress has been released. This version has got 1,217 bug fixes, so upgrading to WordPress 3.0 is must must. Get ready to upgrade to WordPress 3.0 as this is a major update so you have to prepare for the update before actually trying it on your live site.

Major new features of this upgrades are the new default theme “Twenty Ten“. ¬†Wordpress MU is now part of WordPress, so now you can run off multiple sites from your single WordPress install. One feature that will going to be very useful for WordPress blog administrators is the bulk upgrade of plugins, you can now upgrade all selected plugins with just one click.

You must watch the WordPress 3.0 tour video, specially in HD to catch the Easter eggs (that is what the announcement blog says):

When are you planning to upgrade to WordPress 3.0? Is your theme WordPress 3.0 ready? Are you plugins WordPress 3.0 ready?

WP Super Cache 0.9.9.2 has been released

WP Super Cache 0.9.9.2 has been released, this is the biggest release because it support WordPress 3.0 which will be coming out very soon. So now the users will not have to wait for WP Super Cache to be WordPress 3.0 compatible, it already works with it.

The other major features being added to this release are:

  • Better support for mobile plugins.
  • Cache preloading to cache every post of the blog.
  • Cache tester to test if home page of the blog has been cached.

The only glitch which only affects huge blogs (specially those with more then 32K posts) is that Cache preloading will cache all posts of your blog which means you will hit the file system limits, so if your blog is hosted on ext2 or ext3 file systems (99% chance it is) then you should be careful about this feature. You can read more about the issue at WordPress.org support forum. Read official release announcement here.

Have you tried WP Super Cache 0.9.9.2 yet? Are you going to upgrade to it or will you wait till WordPress 3.0? Let us know.

Jailbreak iPad running iPhone OS 3.2 using Spirit

So you own an iPad and you are one of those curious people who want to break into things to see how they work? Or you don’t like being restricted and controlled by Apple. What ever your reasons are the iPhone OS hackers were able to Jailbreak the iPad in just 24 hours of its availability in Apple Stores. So, here is the little guide to help you jailbreak your iPad running on iPhone OS 3.2.

NOTE: First you should take backup of your SHSH blobs so you can restore to iPhone OS 3.2, later.

We will use Spirit to jailbreak the iPad. Using Spirit is very simple. Follow the steps below to Jailbreak the device.

Step 1: Most important step, backup your device using iTunes.

Step 2: Download the Spirit jailbreak for Mac OS, Windows or Linux, depending on the OS you are using. [ Alternate link for Windows Spirit ]

Step 3: Connect your iPad to your computer.

Step 4: Run the Spirit jailbreak application. If you are on Window run it as administrator.

Step 5: Click the “Jailbreak” button.

Jail break iPad using Spirit

Step 6: Upon successful jail-breaking you will see the message on Spirit “Jailbreak complete” and the “Quit” button, also the iPad will restart.

Step 7: When the iPad is booted again, you will see the Cydia app store installed.

Thats it. Enjoy your jail-broken iPad, you can download and install any application you want, the applications you install does not have to be approved from Apple. Do you have an iPad? Have you jail-broken it? Or will you jailbreak it?

Blogging on iPad using Apple Pages

Apple Pages a perfect application for writing blog posts on iPad. As I previously posted about WordPress application for iPad and Blogpress for iPad, both the application had their limitations. None of them were true WYSIWYG editors.

After getting disappointed by WordPress app and Blogpress, I decided to give Apple Pages a try. The applications is a bit costy but I think it’s worth the price.

See the screenshot below to get the idea on how Apple Pages looks like.


Adding images is piece of cake, you can not only just add images but you can resize them, move them and rotate them.

Apple Pages is a complete word processor app, which you can use for editing and creating your documents too. It comes with. Few standard templates which you can use as base for your document.


You can also export your documents to PDF.


Publishing the content you create on Pages is as easy as copying and pasting, or better say it is actually copyingnthe content and pasting into wordpress compose window.

Have your tried Apple Pages on your iPad?

Save SHSH Blobs (ECID SHSH) of iPad 3.2

UPDATE: This howto is obsolete, please follow the steps mentioned on Save SHSH Blobs of your iPad/iPhone and iPod touch before upgrading to iOS 4.2

SHSH Blob needs to be saved if you want to jailbreak your iPad. If you don’t save SHSH Blob all your Jailbroken functionality will be lost if Apple may release the new firmware. Why it needs to be saved? we will see later in more detail. But first let me tell you what the heck is SHSH Blobk or ECID SHSH anyway?

SHSH Blobs are basically signature of your firmware installed on your iDevice. They are checked against Apple servers and allow you to restore a particular firmware on your device. This applies to all devices including iPhone, iPod touch and iPad. When Apple releases new firmware it stops signing the old firmware and hence you can’t restore back to older firmware through iTunes.

You must have got the idea why you need to save SHSH Blob before, let me give you a bit more insight on this. The developer of Cydia has configured a server which provides Apple like verification service and can save your SHSH signature to allow you to downgrade or restore the older firmware. So if you don’t have your SHSH blob saved and update your firmware you know that you will lose your jailbroken functionality, not only that but you won’t be able to downgrade to older firmware or rejailbreak your device.

There are numerous ways to store SHSH blob but the most easiest is to use AutoSHSH. Follow the steps below to save your SHSH using AutoSHSH.

Step 1: Backup your device. Open iTunes connect your iPad and make a backup.

Step 2: Download AutoSHSH (rapidshare link). (Note: You will also need JVM installed on your machine).

Step 3: Connect your device in recovery mode by turning your iPad off and then pressing “Home” button while connecting to USB cable, keep Home button pressed until you see “Connect to iTunes” message on your iPad.

Step 4: Start AutoSHSH which you downloaded in Step 1.

Step 5: Click the “Grab my SHSH blobs Automatically” button.

AutoSHSH saves SHSH blobs

Step 6: AutoSHSH will ask you the location to store your blobs. Select a safe location.

Congratulations you have saved your SHSH blobs, now you can go and jailbreak your iPad.