This is my site here:
Up until recentley my Tweets where displaying fine, however now I am getting this error in the console:
XMLHttpRequest cannot load http://www.incomebrokers.com/js/get_tweets.php. Origin http://incomebrokers.com is not allowed by Access-Control-Allow-Origin.
I don't know why it has just stopped working...Can anyone help me out?
This is my get_tweets.php
script:
session_start();
require_once('twitteroauth/twitteroauth/twitteroauth.php');
$twitteruser = "xxxxxxx";
$notweets = 30;
$consumerkey="xxxxxxxxxx";
$consumersecret="xxxxxxxxxxxxxxx";
$accesstoken="xxxxxxxxxxxxxxxxxxxxx";
$accesstokensecret="xxxxxxxxxxxxxxxxxxxxxxxxxx";
function getConnectionWithAccessToken($cons_key, $cons_secret, $oauth_token, $oauth_token_secret){
$connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $oauth_token_secret);
return $connection;
}
$connection = getConnectionWithAccessToken($consumerkey, $consumersecret, $accesstoken, $accesstokensecret);
$tweets = $connection->get("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$twitteruser."&count=".$notweets);
echo json_encode($tweets);