Fatal error: Class 'Abraham\TwitterOAuth\TwitterOAuth' not found in.. in the sub folder

Tuesday, November 3, 2015

I am trying to tweet posts to my twitter account.
Therefore I am trying famous https://github.com/abraham/twitteroauth script.



My folder structure is:



www.mysite.com/twitterbot/
|-- twitteroauth (folder)
| |-- Util (folder)
| | `-- JsonDecoder.php
| |-- Config.php
| |-- Consumer.php
| |-- HmacSha1.php
| |-- Request.php
| |-- Response.php
| |-- SignatureMethod.php
| |-- Token.php
| |-- TwitterOAuth.php
| |-- TwitterOAuthException.php
| `-- Util.php
`-- index.php


And my index.php



    <?php

require "twitteroauth/autoload.php";
use Abraham\TwitterOAuth\TwitterOAuth;
$consumerKey = "myconsumerkey"; // Consumer Key
$consumerSecret = "mycinsumersecret"; // Consumer Secret
$accessToken = "myaccesstoken"; // Access Token
$accessTokenSecret = "my access token secret"; // Access Token Secret
$connection = new TwitterOAuth($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret);
$statues = $connection->post("statuses/update", array("status" => "I'm posting a tweet!"));

?>


When I visit to www.mysite.com/twitterbot/ is says **Fatal error**: Class 'Abraham\TwitterOAuth\TwitterOAuth' not found in mysitecom/twitterbot/index.php on line 8



8th line is $statues = $connection->post("statuses/update", array("status" => "I'm posting a tweet!"));



What I am doing wrong?
how can I fix this?

0 comments:

Post a Comment