So for all of you twitters out there here is a little tutorial how to write your own IM bot to easily update twitter using IM client. I know i know you can use the official IM twitter bot BUT it is down right now. So, why not use your own.

First of all read post How to Write Your Own IM Bot in Less Than 5 Minutes

Follow all the steps and create your own bot.
Next add the following code to the .php script from the IM Bot blog post.

// Set username and password
$username = 'user';
$password = 'pass';
// The message you want to send
$message = $_REQUEST['msg'];
// The twitter API address
$url = 'http://twitter.com/statuses/update.xml';

$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, "$url");
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_POST, 1);
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "status=$message");
curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
// check for success or failure
if (empty($buffer)) {
echo 'message';
} else {
echo 'success';
}



Thats it!
enjoy!

Views: 62

Comment

You need to be a member of Codetown to add comments!

Join Codetown

Comment by Zemian Deng on December 3, 2008 at 10:31pm
I don't use twitter, but it's a cool bot service by imified. Thanks for the link and sample script!

Happy 10th year, JCertif!

Notes

Welcome to Codetown!

Codetown is a social network. It's got blogs, forums, groups, personal pages and more! You might think of Codetown as a funky camper van with lots of compartments for your stuff and a great multimedia system, too! Best of all, Codetown has room for all of your friends.

When you create a profile for yourself you get a personal page automatically. That's where you can be creative and do your own thing. People who want to get to know you will click on your name or picture and…
Continue

Created by Michael Levin Dec 18, 2008 at 6:56pm. Last updated by Michael Levin May 4, 2018.

Looking for Jobs or Staff?

Check out the Codetown Jobs group.

 

Enjoy the site? Support Codetown with your donation.



InfoQ Reading List

Improving Threads' iOS Performance at Meta

An app's performance is key to make users want to use it, say Meta engineers Dave LaMacchia and Jason Patterson. This includes making it lightning-fast, battery-efficient, and reliable across a range of devices and connectivity conditions. In a recent article, they recounted their experience with the Threads app.

By Sergio

LLaMA-Mesh: NVIDIA’s Breakthrough in Unifying 3D Mesh Generation and Language Models

NVIDIA researchers have introduced LLaMA-Mesh, a groundbreaking approach that extends large language models (LLMs) to generate and interpret 3D mesh data in a unified, text-based framework. LLaMA-Mesh tokenizes 3D meshes as plain text, enabling the seamless integration of spatial and textual information.

By Robert Krzaczyński

How to Go from Copy and Paste Deployments to Full GitOps

InnerSource helped reduce the amount of development work involved when introducing GitOps by sharing company-specific logic, Jemma Hussein Allen said at QCon London. She showed how they went from copy and paste deployments to full GitOps. She mentioned that a psychologically safe environment is really important for open and honest discussions that can help resolve pain points and drive innovation.

By Ben Linders

Presentation: Panel: What Does the Future of Computing Looks Like

This panel dives into advancements that will redefine how we interact with technology, exploring new concepts and discussing their potential to transform the world.

By Julia Lawall, Matt Fleming, Joe Rowell, Thomas Dullien

Presentation: Leveraging Internal Developer Portals to Achieve Strategic Initiatives

Frank Fodera discusses how they introduced an IDP at CarGurus, the key features that contributed to achieving critical mass within their organization, and how they leveraged the IDP.

By Frank Fodera

© 2025   Created by Michael Levin.   Powered by

Badges  |  Report an Issue  |  Terms of Service