I've just added the Twitter button on my blog under each post, but the tweets number displayed is the same on each button and is random.
In addition to this, if I enter to a post the number displayed change :S
Any idea about this issue?
EDIT:
This is the code that I'm actually using for the Twitter button
<a class='twitter-share-button' data-count='horizontal'data-lang='it'
data-via='ZOMBIEKB' expr:data-text='data:post.title'
expr:data-url='data:post.url' href='https://twitter.com/share'>Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)
[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=&
quot;//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore
(js,fjs);}}(document,"script","twitter-wjs");</script>
Each widgets data-url has to point to the url of the post it is describing not yout blog url:
yes: data-url="http://www.zombiekb.com/url-to-this-post/"
no: data-url="http://www.zombiekb.com/"
Related
I've followed the guide here to add multiple widgets using the same widget id and this works perfectly fine for User timeline.
Snippet ----
<a class="twitter-timeline" href="https://twitter.com/benward" data-widget-id="[id]" data-screen-name="benward">
<a class="twitter-timeline" href="https://twitter.com/endform" data-widget-id="[id]" data-screen-name="endform">
<a class="twitter-timeline" href="https://twitter.com/kang" data-widget-id="[id]" data-screen-name="kang">
<a class="twitter-timeline" href="https://twitter.com/brianellin" data-widget-id="[id]" data-screen-name="brianellin">
What I would want to do is do the same( show different widgets ) for multiple hashtags - #MH17, #MH370 on the same page. But these tags change for each article on a page.
I want to know if either of these is possible.
Can I make the same guide available for a search query to this and this without creating a widget manually from the Twitter page. Timeline changes when I change the "data-screen-name" property. Is there something like "data-hashtag-name"?
Is it possible to use Twitter API or something to automate the process of creating a widget from the browser using Auth Token - Secret?
May be this help you .
Here i am sending you some example using this I am get json and render html div
Here is a sample code and demo you can use for search in twitter
1) http://www.codexworld.com/create-custom-twitter-widget-using-php/
2)you can also look into this examle may be this will full fill your requirement .
http://dev.kim-maida.com/twitter/
3) here is demo code and code sample link.
https://github.com/kmaida/twitter-timeline-php
did you see these pages?
https://dev.twitter.com/web/embedded-timelines/search
https://twitter.com/settings/widgets/new/search
You can do this:
corgi is the sample hashtag:
<a class="twitter-timeline" href="https://twitter.com/hashtag/corgi" data-widget-id="612280670367301632">#corgi Tweets</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
I am currently creating a Tweet button for my website but have little knowledge of Twitter. I would like the text to say something similar to 'I like' and be followed by the title and url for the current page. I can make it display the text that I would like, or the page title, but cannot seem to get the text AND the page title into the tweet together.
So I would like the tweet to be... 'I like [page title] at Phil's website - [url for specific page]'
Is it possible to get it from meta data and open-graph similar to how facebook works?
Thanks in advance for any help, the code below is taken from the Twitter website with a few edits made.
Tweet<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
I was thinking of setting up some tweet buttons for people to tweet out various sections of a long article using #anchor tags
eg a URL like this
http://www.w3schools.com/html_links.htm#tips
http://www.w3schools.com/html_links.htm#questions
There would be a Tweet button next to each Anchor Tag
Is this possible and will each tweet button have their own unique Count on their respective buttons?
eg
Tweet<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
Tweet<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
Many thanks in advance
Cheers
Andy
Twitter disregards #fragments in their tweet button counts so multiple tweet buttons linking to multiple sections of a single page will all have the same count. You can have multiple tweet buttons on a single page with different counts but they will have to be fore separate pages. For example a blog of example.com could have two tweet buttons with different counts but they would have to be for:
example.com/1
example.com/2
A workaround is to play with GET values. You can use this kind of url for the tweeter button :
http://www.w3schools.com/html_links.htm?anchor=tips
http://www.w3schools.com/html_links.htm?anchor=questions
Then, you add some JS to jump to the anchor when the user come from tweeter.
I'm looking into using the Twitter tweet button API, found: here
I have the following code:
<a href="http://twitter.com/share" class="twitter-share-button"
data-url="http://myurl.com/howtouse"
data-counturl="http://myurl.com/howtouse"
data-text="How to use this site"
data-count="vertical"
>Tweet</a>
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
My problem comes with the count. When I hit the 'tweet' button, the popup appears. I post to twitter all fine. The problem then comes with when I then click on the count box, which is 0.
The URL of this is: http://twitter.com/#search?q=http%3A%2F%2Fmyurl.com%2Fhowtouse%2F
Which when clicked returns no results even though I can see the tweet in my timeline.
Does anyone have any ideas why the search wouldn't find the link I shared/tweeted and why the count is 0?
Thanks
There are a number of reasons that Tweets don't show up in search that range from quality filtering to time: http://support.twitter.com/articles/66018-my-tweets-or-hashtags-are-missing-from-search
The tweet count being 0 can be an effect of caching. Generally tweet button counts take a few hours to update for performance reasons and are often inaccurate by a % as well.
To give you a simple use case - on my website, I display the comments posted by the facebook users. For each comment I display the facebook users photo using the fb:profile-pic tag and a fb like button.
This page renders properly and everything displays well. Now when the users want to read older comments, they click on the "More" link
Using Jquery, I pull the older comments and in the javascript build the content adding the fb:profile-pic and the fb:like tags
But these tags dont show up. Do we need to reload it or something.
Thanks for your help
First make sure the FBML is being inserted into the DOM with an inspector. If so, all you need to do is tell Facebook to convert the FBML tags to HTML tags so your browser can render it. With the Graph API you call FB.XHTML.parse http://developers.facebook.com/docs/reference/javascript/FB.XFBML.parse using the Javascript SDK. Here's an example from my code:
$('#list').append('<fb:name uid="4"></fb:name>');
FB.XFBML.parse(document.getElementById('list'));
how do I do that - like right now I
build my entire string say
comment="<div>I love
icecream<br/><fb:profile-pic
uid='xxx'></fb:profile-pic></div>"
Then I would do
$("#myswipes").html(comment); So how
would I reload.
you can use $.ajax(), say
$('a.moreComment').click(function(){
$.ajax({
url: 'some/url.php',
success : function(comment){
$("#myswipes").html(comment);
}
});
})
some/url.php should be in the server that can correctly render and return this line, <div>I love icecream<br/><fb:profile-picuid='xxx'></fb:profile-pic></div>