This question already has answers here:
Dealing with < in tw:counturl addthis plugin
(2 answers)
Closed 3 years ago.
I have added a Addthis plugin for blogspot for social networking sharing. The tweet count button for some reason is showing zero always, though the link has been tweeted multiple times.
I have verified using http://cdn.api.twitter.com/1/urls/count.json?url=
My blog website is http://rohit-cricket.blogspot.in/2012/10/turning-twenty-three-and-counting.html
There is no point of pasting code here, as Addthis expands when the page is loaded. It can be seen using Inspect element of google chrome.
Please help
Twitter describes a couple possibilities as to why your count may not be incrementing:
To improve performance we cache the count before displaying it. The cache is updated frequently but on some occasions it may look like your count is not increasing while the cache is updated. In addition, the count only includes public Tweets meaning a Tweet from a protected account will not cause an increase.
Additionally, there is currently a requirement that your server support HTTP HEAD requests in order to update the count properly. An easy way to check this is to use the command-line curl program, passing the -I (capital i) flag. A successful request should have a HTTP 200 OK response
Source: https://dev.twitter.com/docs/tweet-button/faq#count-api-increment
Also, try updating the link to tweet:
<a class="addthis_button_tweet" tw:counturl="http://yoururltocount.com/">
Found answer here: http://www.addthis.com/forum/viewtopic.php?f=4&t=30188
Related
Right now im building a simple html/css site for a friend. The homepage is a series of grid block divs that hold some content.
There are currently 3 block divs we have marked for social media posts. So for example, he wants his latest tweet to appear in one of those divs. His latest instagram post to appear in another and facebook in the last.
We can ignore facebook for the time being as I'm only focusing on the twitter/instagram for now.
I'm struggling with where to begin for this project. In the past I have only embedded twitter timelines, Instagram posts using widgets etc....nothing too complicated.
But for this project I will need separate stripped down posts, ie: just the plain text from his tweet inside the twitter div. The image from his Instagram post as the background image on the Instagram block etc...
I've spent the last few hours trying to get my head around oEmbed, and I can safely say I'm failing miserably.
I'm actually more confused now then before I started, so if any kind soul could give me a dummies guide to how I can approach this, that would be absolutely amazing.
Thank you!
You can acheive a single embedded tweet using an embedded timeline.
To get just one tweet, use the data-tweet-limit attribute on the embed tag, as detailed here:
https://dev.twitter.com/web/embedded-timelines/parameters
For example:
<a class="twitter-timeline" href="https://twitter.com/TwitterDev" data-widget-id="some_id" data-tweet-limit="1"></a>
According to twitter's documentation, that is the recommended way of getting tweets onto websites. From your description of the use case, I'd highly recommend just using Twitter's official widget.
If you really want to use Twitter's REST API and generate your page server side, I'd check out this stack overflow question as a starting point:
Setting up Twitter API, getting the last few Tweets
Hope that helps!
I'm attempting to get comments from YouTube, both through the web interface and the v3 API, but I'm having problems with (dis)agreement between the two sources.
One major issue I'm facing is that I frequently see comments in API results that don't appear when reading comments on the web.
For example, take a look at this comment thread (comment z13ivlkotmmjgriuh23uxzjanmetidby004 on video H5Vzo-iPGCo) on the web, then compare this to API results from the following requests:
GET https://www.googleapis.com/youtube/v3/commentThreads?part=replies&id=z13ivlkotmmjgriuh23uxzjanmetidby004&key={YOUR_API_KEY}
and
GET https://www.googleapis.com/youtube/v3/comments?part=id%2Csnippet&parentId=z13ivlkotmmjgriuh23uxzjanmetidby004&key={YOUR_API_KEY}
In both cases the API returns the reply with id z13ivlkotmmjgriuh23uxzjanmetidby004.1444155855551960, which does not show up in the web UI. Also noteworthy here is that the web UI says "View all 10 replies," and then only displays nine.
I've encountered this on many comment threads (both replies and top-level comments, but mostly replies; most of them are too vulgar/offensive to include as examples here...), and I'm struggling to figure out what may be the cause of the invisible comments. Is there something in particular that causes this to occur? Is it indicative of something?
Aside: I've been working on this for several weeks at this point, and I've noticed that some of the comments exhibiting this behavior a few weeks ago no longer show up when searching with part=replies or with the parentId parameter, but still show up when searching for their id directly. Example, mild profanity included:
GET https://www.googleapis.com/youtube/v3/comments?part=id%2Csnippet&id=z121czphkmm1vhyy504cgxda3qfczhf4pi0.1428512050956459&key={YOUR_API_KEY}
vs.
GET https://www.googleapis.com/youtube/v3/comments?part=id%2Csnippet&parentId=z121czphkmm1vhyy504cgxda3qfczhf4pi0&key={YOUR_API_KEY}
The bottom line: I'd expect the API to give me the same comments as the web interface, but this often is not the case. Is there a logical reason or cause for the disagreements?
I've been using the old url api(v1) to get the count of a given url, lately I needed to get also the re-tweets and started searching about that.
this is the exact url I'm using right now:
http://urls.api.twitter.com/1/urls/count.json?url=http://google.com
As I viewed with some reading the v1 api is deprecated but at least it's still working.
I found some questions on the dev page of twitter:
https://dev.twitter.com/discussions/12643
those are a little old questions and have no specific solving to the problem. I mean, the most near solution was using the search api(search/tweets) which could be good but not a exactly replacement for the urls/count method.
Please note that Twitter's search service and, by extension, the
Search API is not meant to be an exhaustive source of Tweets. Not all
Tweets will be indexed or made available via the search interface.
also it has a limit for 100 results at maximum per 'page', even it throws the link to get the next set of objects, thats good but when the search reaches 1 million of results I'll need to get page over page to now how much tweets I got and having to do to much request to the api...
I sought some question over the dev page on twitter suggested using the stream api, I've tried using (statuses/filter) but that don't work very well given a URL as track param(which they said that is the keyword to track).
So, anyone who's been using the old urls/count has found a reliable alternative with the new apiv1.1, especiffically to get the tweets and re-tweets for a given url ?
The official suggestion by Twitter staff is that either the search/tweets endpoint (having just the last 7 days data) or the Streaming API be used (handling yourself the counters, making everything just too complicated for a d*mn counter).
As an extra warning, the old endpoint (http://urls.api.twitter.com/1/urls/count.json?url=YOUR_URL) will stop working on November 20th, and according to this blog post from Twitter there are no plans to replace it with anything in the short term and they are even removing the count from their own buttons.
This question already has answers here:
Rails Browser Detection Methods
(3 answers)
Closed 8 years ago.
I'm trying to record visits to my site, but I keep getting crawlers accidentally setting off my code. Is there any way in rails controllers to determine whether a user is a bot such as googlebot, etc?
You can check HTTP headers, particularly the user agent string.
http://www.useragentstring.com/pages/Googlebot/
Most friendly bots have "bot" in their user agent.
Another suggestion is to use something like Google Analytics to track your visits. It's way better than implementing your own.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
What's the shebang/hashbang (#!) in Facebook and new Twitter URLs for?
I noticed that some popular sites started switching to a new URL (convention?), in which a URI segment is no longer prefixed by / but rather by #!/.
For example, if you type into Twitter http://twitter.com/stackoverflow, it will immediately redirect to http://twitter.com/#!/stackoverflow.
Had I seen this on Twitter only, I wouldn't have thought twice about this, but now I am seeing this in other sites.
Is this a new convention for URL redirection? Where can I learn more about this?
It was started by Google ( http://code.google.com/web/ajaxcrawling/ )
If you're running an AJAX application
with content that you'd like to appear
in search results, we have a new
process that, when implemented, can
help Google (and potentially other
search engines) crawl and index your
content. Historically, AJAX
applications have been difficult for
search engines to process because AJAX
content is produced dynamically by the
browser and thus not visible to
crawlers. While there are existing
methods for dealing with this problem,
they involve regular manual
maintenance to keep the content
up-to-date.
Look at this answer here:
What's the shebang/hashbang (#!) in Facebook and new Twitter URLs for?
The opinion on using this is split - Gawker had major issues after taking this up : http://www.webmonkey.com/2011/02/gawker-learns-the-hard-way-why-hash-bang-urls-are-evil/
It's how Google should index the page when dealing with AJAX