Categories
PHP

PHP-GTK: App to update Twitter

People who have been in touch for a while might have noticed how much twitter addict I have suddenly become. Today, I wrote a php-gtk program to update my twitter status. I developed it using php-gtk2 and cURL.

I was having a lot of troubles developing it. I was using “thread safe” php while GTK is “nts (non thread safe)”. I managed a non thread safe php5 but problems raised with the cURL library. The required dependencies for cURL and mysql were not available with that package. I had to copy those specific files from another package. Again, I was getting confused as the app failed to load cURL repeatedly though I had it enabled in php.ini. Later I found out that when I copied the dependencies, I have also copied a “php-cli.ini” which was substituting the default php.ini since php was running in the CLI mode.

Finally it’s done. I am still a beginner at php-gtk. I didn’t write the program from scratch. I copy-pasted some codes from my other projects and php-gtk manual. But this program is going to be a good source of inspiration for me. I really like php-gtk. I am gonna dig a bit deeper whenever I get some time to spare.

Download: http://masnun.googlecode.com/files/twitter_php_gtk.php

Categories
Python

Python tool to expand short URLs

In one of my last posts, I posted a code snippet which demonstrated how to use php to expand short URLs to their original long form. Here’s the Python version I coded a few minutes ago.

Python 3:

These codes are for Python 3. The tool was developed for CLI use.

Categories
PHP

PHP-CLI: Expand Short URLs

This is a modified version of the code snippet available at: http://hasin.wordpress.com/2009/05/05/expanding-short-urls-to-original-urls-using-php-and-curl/#comment-68180

It’s a php command line tool to expand a provided short url.