-
Notifications
You must be signed in to change notification settings - Fork 799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught Exception: No URL set! in TwitterAPIExchange.php:275 #276
Comments
I just copied and pasted the code just before you edit it, and ran it on my machine, with the tokens you had, and got a result. Can you elaborate on what your error is? |
I displayed the errors by Before I did that I got the error: |
This is the code: require_once('TwitterAPIExchange.php'); /** Set access tokens here - see: https://dev.twitter.com/apps/ **/ /** Perform a GET request and echo the response / $url = 'https://api.twitter.com/1.1/followers/ids.json'; $twitter = new TwitterAPIExchange($settings); |
Could that be authentication with my tokens ? |
@J7mbo Could you help me ? |
I just ran the code you pasted above and it works perfectly. |
I run it on Xampp. |
@J7mbo Did you run the code with the same tokens as mine ? |
Yes. I copied the code from this message, changed nothing, and I get a response back. I would suggest clearing any cache, restarting your web server, and make a change at the top like |
Do you mrun it on your local host ? |
Nope, I just ran it on localhost by typing You can disprove that your problem is a caching one by putting:
at the top of your php file and then refreshing your page and seeing if hello world is printed. If it's not, then there's the problem you need to figure out. Have you done this? |
I have. In twitter developer app configuration |
I wrote the following code and got this issue:
ini_set('display_errors', true);
ini_set('display_errors', 1);
require_once('TwitterAPIExchange.php');
/** Set access tokens here - see: https://dev.twitter.com/apps/ **/
$settings = array(
'consumer_key' => "",
'consumer_secret' => "",
'oauth_access_token' => "",
'oauth_access_token_secret' => ""
);
/** Perform a GET request and echo the response /
/ Note: Set the GET field BEFORE calling buildOauth(); **/
$url = 'https://api.twitter.com/1.1/followers/ids.json';
$getfield = '?screen_name=J7mbo';
$requestMethod = 'GET';
$twitter = new TwitterAPIExchange($settings);
echo $twitter->setGetfield($getfield)
->buildOauth($url, $requestMethod)
->performRequest(); ?>
The text was updated successfully, but these errors were encountered: