Solved

twitter count not working

Posted on 2013-06-20
2
226 Views
Last Modified: 2013-06-26
I got a script to put a twitter button on my site with a count.
yet, even though i tested it out and got people to click on it, it's staying at 0
the code looks like this
<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://kars4kids.us/120huxG" data-text="I pledge not to txt and drive, u shud too!!! #TTYL #DontTextAndDrive" data-via="Kars4Kids">Tweet</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>
</li>

Open in new window


What would I need to do to get a real count?
0
Comment
Question by:rivkamak
2 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39264114
Has twitter crawled your page?
Looking at that page you have a count of 15
And the URL in the code is redirecting - the page must be accessible.
0
 
LVL 16

Accepted Solution

by:
hankknight earned 500 total points
ID: 39265883
Use this code instead:
<a href="https://twitter.com/share" class="twitter-share-button" data-via="http://kars4kids.us/120huxG" data-count="none" data-text="I pledge not to txt and drive, u shud too!!! #TTYL #DontTextAndDrive" data-via="Kars4Kids">Tweet</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>

Open in new window

If you want to customize it further, do so here:
https://twitter.com/about/resources/buttons#tweet

If you use that tool make sure to uncheck the "Show count" checkbox.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how can display objects ? 3 18
JS Plugin 4 29
Google Sheets Script 21 51
Regex in JavaScript to validate US phone number with hyphens 3 27
When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now