Skip to content

Instantly share code, notes, and snippets.

@abraham
Created September 22, 2010 17:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abraham/592098 to your computer and use it in GitHub Desktop.
Save abraham/592098 to your computer and use it in GitHub Desktop.
Simple script to post a Tweet using XML and OAuth
<?php
// Download the latest version of http://github.com/abraham/twitteroauth/downloads
// Move twitteroauth.php and OAuth.php into this directory.
// Register an application at http://dev.twitter.com/apps.
// Get a user access token as described in http://dev.twitter.com/pages/oauth_single_token.
require_once('twitteroauth.php');
$connection = new TwitterOAuth('app consumer key', 'app consumer secret', 'my access token', 'my access token secret');
$connection->format = 'xml';
$status = $connection->post('statuses/update', array('status' => $message));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment