I've got the following code, and I cannot understand as to why it isn't returning and printing it in the HTML body..
var pageURL = document.URL;
var tweet = "https://cdn.api.twitter.com/1/urls/count.json?url='"+ pageURL + "'";
$.getJSON(tweet,function(json){
$('#twitterfeed').html(json.count);
});
<div id="twitterfeed"></div>
https://cdn.api.twitter.com/1/urls/count.json?url=http://www.google.com
returns {"count":23844636,"url":"http://www.google.com/"}
The following doesn't seem to work, does anyone have any idea as to why?
To access your Tweet activity: On a desktop or laptop computer, visit analytics.twitter.com and click on Tweets. In the Twitter app for iOS or Android, tap the analytics icon visible in your Tweets. Make sure you have installed the latest version of Twitter for iPhone, iPad, or Twitter for Android.
Open a web browser and input Twitter.com into the address bar. Find the profile icon in the left column and click it. Your browser's address bar at the top of the screen will display your Twitter URL as twitter.com/username.
You have space for only one link in your Twitter Bio! Your Twitter bio link is the single most important part of your Twitter profile. The first thing anyone notices when they land on your Twitter account is your Twitter bio.
But in regards to whether or not spaces count as characters on Twitter, the answer is Yes. Spaces between words count towards the 280 character Twitter limit.
As of 20th November 2015 there's no Tweet count API, so don't bother: https://blog.twitter.com/2015/hard-decisions-for-a-sustainable-platform
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With