Tag Archives: tricks

Setting Up Email Server on your PC

If you setup an email server on your PC, you can easily send unlimited emails with a custom “From” address This is particularly helpful if you want to send emails programmatically for some reasons (I like to send unimportant emails … Continue reading

Posted in Blog Post | Tagged , , | Leave a comment

Interactive PHP Shell

You might have seen the cool interactive shell of python. And/Or the IDLE that comes with Python for Windows and as an add on for Python on Linux ? That’s really handy for prototyping. Isn’t that ? Well, I always … Continue reading

Posted in Blog Post | Tagged , , | 1 Comment

Converting Videos Using PHP

In fact, video conversion on the server side is done by other softwares. PHP itself is used as a medium for the task maximum times. We have a nice command line tool named “ffmpeg” to convert videos. I am currently … Continue reading

Posted in Blog Post | Tagged , | Leave a comment

Twitter Bot Earns Me Money :)

Well, this came up as a pleasant surprise to me when I logged into my GetAFreeLancer.com account to deactivate the email notification. I have earned $34.2 in August 2009 from affiliate activity. I was puzzled first and then checked out … Continue reading

Posted in Blog Post | Tagged , , | 2 Comments

SQLite, PHP and Portable Abyss Web Server X1

I was looking for a portable web server for a long time. And finaly I have found one. You might have read about that in my last post. Just after I started using this web server, I began to worry … Continue reading

Posted in Blog Post | Tagged , | 1 Comment

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: import http.client … Continue reading

Posted in Blog Post | Tagged , | Leave a comment

u.nu, the shortest urls: the API

Here’s a simple code snippet copied from the home page of u.nu. <?php $original_url = ‘http://www.google.com/’; $request = ‘http://u.nu/unu-api-simple?url=’ . urlencode($original_url); $response = file_get_contents($request); if (substr($request, 0, 4) == ‘http’) { echo “Shortened URL = $response”; } else { list … Continue reading

Posted in Blog Post | Tagged , , | Leave a comment

Python CLI App to update friendfeed: My way

I wrote a python CLI program to use the mobile friendfeed publisher at http://masnun.com/ff/. It just posts the credentials to the mobile page, then the mobile page makes the update to friendfeed. Source: http://myfriendfeed.googlecode.com/files/friendfeed.py

Posted in Blog Post | Tagged , , | Leave a comment

Python: CLI App to update Twitter status

In my previous post, I have published the source codes to build a CLI php app to update your twitter status. Here comes the Python version…. It’s been a pain… took me 15 long minutes to cook it… I was … Continue reading

Posted in Blog Post | Tagged , | Leave a comment

Updating Twitter status using PHP CLI

Here’s the source file : <?php $username = $argv[1]; $password = $argv[2]; $message = $argv[3]; $tweetUrl = “http://{$username}:{$password}@www.twitter.com/statuses/update.xml”; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $tweetUrl); curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, “status={$message}”); $result = curl_exec($curl); ?> … Continue reading

Posted in Blog Post | Tagged , | Leave a comment