How do I use Twitter OAuth without composer?

Viewed 124

I am at present following an online course about building a Twitter app but have failed to get my code to authorise my Twitter credentials. In the course I am following when the instructor outlines how to use TwitterOAuth to vailidate credentials there is a section on twitterouth.com concerning the old fashioned method or manual method which I suppose means without using composer. So I followed this method but it doesn't appear to work and it no longer appears on twitteroauth.com. I'm not entirely sure if composer is installed or I can use it on the server where my website is hosted so I was wondering what I could do so that my fledgling app could use my Twitter credentials to get authorised.

My code at present looks like this:

<?php
require "autoload.php";
use Abraham\TwitterOAuth\TwitterOAuth;
$consumerKey = "My key here";
$consumerSecret = "My key here";
$accessToken = "My key here";
$accessTokenSecret = "My key here";
$connection = new TwitterOAuth($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret);
$content = $connection->get("account/verify_credentials");
print_r($content);

?>

I don't think the required library is getting loaded to authenticate my credentials. I really do hope somebody can help!

Regards

Nick

0 Answers
Related