Solved

twitter count not working

Posted on 2013-06-20
2
224 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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Python On Mouseover Save URL/Link 4 29
Accessing data in JSON response.d 4 27
Hidden Field Value 10 34
Different Delete Messages 7 10
Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
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…

743 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