32,000+ SUBSCRIBERS CAN'T GO WRONG !!!

phpans
GET TOP ARTICLES, SNIPPETS, SCRIPTS IN YOUR INBOX FOR FREE!

Delivered by GET EMAIL UPDATES FeedBurner
We always respect your privacy and take protecting it seriously.
We won't Spam You

PHP Date Function Tutorial

, 0,
PHP Date Function Tutorial
Multiple Twitter Accounts Post: Today we are going to create a project so that we can post multiple twitter accounts in a single click. We know twitter is a microblogging site, it's most popular social community also. Nowadays, most of the internet marketers promote their stuff in twitter. So twitter is most important and a big part of social media marketing. In our project, we make twitter sharing easier.

How to Multiple Twitter Accounts Post?


We use Codebird API library and Twitter App and PHP functions for make this project.

How to Multiple Twitter Accounts In PHP?


Yes, now we are on the way to create this project finally. Follow these steps step to step. Create a PHP file name as tweet.php and include this codebird library into this file. Write down this code,

<?php
@error_reporting(0);
@error_log(NULL);
@session_start();
require_once('codebird.php');
function tweet($message,$media,$cusomerkey,$cusomersecrate,$token,$tokenSecret)
{
\Codebird\Codebird::setConsumerKey($cusomerkey, $cusomersecrate);
$cb = \Codebird\Codebird::getInstance();
$cb->setToken($token, $tokenSecret);

$params = array(
'status' => "$message",
'media[]' => "$media"
);
$reply = $cb->statuses_updateWithMedia($params);
return $reply;
}
$time = $_SESSION['time'];
$perm = $time+120;
if (isset($_POST['message'])&&isset($_POST['media']))
{
if(time()<$perm)
{
echo 'Flood limit';
exit;
}
$message = $_POST['message'];
$media = $_POST['media'];
tweet($message,$media,,$cusomerkey1,$cusomersecrate1,$token1,$tokenSecret1);
tweet($message,$media,$cusomerkey2,$cusomersecrate2,$token2,$tokenSecret2);
tweet($message,$media,$cusomerkey3,$cusomersecrate3,$token3,$tokenSecret3);
$_SESSION['time']= time();
echo 'Shred Successfully!';
}
else
{
echo '<form method="post">';
echo '<b>Message:</b><br/><textarea name="message"></textarea><br/>';
echo '<b>Image Link:</b><br/><input name="media"><br/>';
echo '<input type="submit" value="Share">';
echo '</form>';
}
?>


Now you need to create twitter Application. After creating a twitter application you will get a customer key and customer secret. Then you need to create twitter access token and set them into this script to config it.
Twitter Application
I have added only three accounts to config. If you want you can add more account as you like. After complete config then run this script on your server then you will get a form if everything will good. Then you will get two input box one for input message and another for input media link. Fill them with your message and image link and click on share button.
Multiple Twitter Accounts Post In PHP Tweet
After completing this you will get a success message. Now check your accounts. Your tweet would be share in all of your accounts. That's all, we have created this project successfully.

I hope Multiple Twitter Accounts Post help you to make twitter platform easy. If you have any question or comment about this Multiple Twitter Accounts Post please don't hesitate to do that, please comment your question in comment section.

Download PDF
Is this article helpful for you?





captcha

  • Connect
  •       
Top
Create an free account and start learning & sharing! Sign Up