Truemag

  • Categories
    • Tips And Tricks
    • Internet
    • PHP
    • Javascript
    • CSharp
    • SQL Server
    • Linux
  • Lastest Videos
  • Our Demos
  • About
  • Contact
  • Home
  • Write With Us
  • Job Request
Home PHP PHP auto post tweet to Twitter

PHP auto post tweet to Twitter

This tutorial will show you how to post new tweet to Twitter automatically by using Twitter API and Twitter OAuth.

 

 

 

 

1. Register your applicaion

twitter application detail page

twitter application detail page

Note: the “Default Access type” need to be set to “Read & Write” as your application is allowed to post new tweet to Twiter.

2. Consumer Secret and Consumer Key

After your application is created, you should have the required information, Consumer Secret and Consumer Key.
Find them in the Application details page.

3. Access Token and Access Token Secret

You should find them by clicking on the “My Access Token” link in the right menu (still on your Application detail page).

4. Download Twitter OAuth class

Go here to get them (OAuth.php, twitteroauth.php)

Note: they are included in Source code example for this tutorial already. 🙂

5. Finally, PHP script for you

[php] <?php
$consumerKey = ‘your-consumer-key’;
$consumerSecret = ‘your-consumer-secret’;
$oAuthToken = ‘your-access-token’;
$oAuthSecret = ‘your-token-secret’;

require_once(‘twitteroauth.php’);

$tweet = new TwitterOAuth($consumerKey, $consumerSecret, $oAuthToken, $oAuthSecret);

$tweet->post(‘statuses/update’, array(‘status’ => ‘PHP auto post tweet to Twitter. Read more: http://4rapiddev.com/php/php-auto-post-tweet-to-twitter/’));

?>
[/php]

+ Download full source code example

Mar 7, 2011Hoan Huynh
PHP measure/ calculate execution time of loading pageLink download Stack Overflow, Server Fault, Super User, and Meta Database
You Might Also Like:
  • Place Twitter Tweet Button On WordPress
  • Free service auto post to Facebook,Twitter,Google Buzz and LinkedIn
  • Share Link/ Url Of Facebook, Twitter, Google Plus, Stumbleupon, Reddit, Digg and Tumblr
  • PHP Auto Post A Story Content To Digg, StumbleUpon, Tumblr and LinkedIn
  • Get WordPress Short Link And Full Link To A Post
  • Facebook Load User Profile Via Graph API And FQL Query
  • PHP Check If User Like Facebook Page
  • Auto Rotate Web Page Title With JavaScript
  • Keep Posting When You’re On Vacation With WordPress Post TimeStamp
  • PHP CURL Post To HTTPS Website
Hoan Huynh

Hoan Huynh is the founder and head of 4rapiddev.com. Reach him at [email protected]

10 years ago PHPConsumer Key, Consumer Secret, OAuth, Twitter API361
0
GooglePlus
0
Facebook
0
Twitter
0
Digg
0
Delicious
0
Stumbleupon
0
Linkedin
0
Pinterest
Most Viewed
PHP Download Image Or File From URL
21,932 views
Notepad Plus Plus Compare Plugin
How To Install Compare Text Plugin In Notepad Plus Plus
19,767 views
Microsoft SQL Server 2008 Attach Remove Log
Delete, Shrink, Eliminate Transaction Log .LDF File
15,600 views
JQuery Allow only numeric characters or only alphabet characters in textbox
13,117 views
C# Read Json From URL And Parse/Deserialize Json
9,570 views
4 Rapid Development is a central page that is targeted at newbie and professional programmers, database administrators, system admin, web masters and bloggers.
Recent Posts
  • Essay Writing Service Tips For The Online Essay
  • Research Paper Writing Service
  • Annotated Bibliography Example – How it Can Help You
  • Essay Writing Online Tips – How to Write Essays Online With Essay Proof Editing
  • Get Research Paper Assistance From Professional Help
Categories
  • CSharp (45)
  • Facebook Graph API (19)
  • Google API (7)
  • Internet (87)
  • iPhone XCode (8)
  • Javascript (35)
  • Linux (28)
  • MySQL (16)
  • PHP (84)
  • Problem Issue Error (29)
  • Resources (32)
  • SQL Server (25)
  • Timeline (5)
  • Tips And Tricks (141)
  • Uncategorized (64)
Recommended
  • Custom Software Development Company
  • Online Useful Tools
  • Premium Themes
  • VPS
2014 © 4 Rapid Development