Are you a web publisher who has implemented the Tweet Button, Follow Button, or Web Intents? Please ask a question or send us your feedback


#1

If you are a web publisher or website owner who has implemented Twitter for Websites tools, you may have some comments, questions, or feedback for us. Feel free to ask about the following topics in this thread:


#2

Hi,

I’ve just read up on the new Web Intents and their JS Events and tried to implement the tweet intent for the first time. I simply added a link to https://twitter.com/intent/tweet?. and then bound a handler to the tweet event, as twttr.events.bind(‘tweet’, function (event) { … } );

All works well – the tweet posts and the handler captures the event – except that event.data comes back null in the handler. Is there something I’m missing in the implementation? The only thing I can think of is authentication, but from the docs it does not appear that that is necessary, since the user is automatically prompted to log in/sign up (if not already logged in) when they click the link to the intent.


#3

Hi @_teatime,
The Tweet intent doesn’t typically return data in the data attribute of the event – you’ll be able to detect the fact that the tweet happened, but not the specifics of the tweet (text, user, or id of tweet) that was issued.


#4

How do I implement a Mini Profile into my own website?


#5

Hi @Lucki_@2011,

To implement a mini-profile for your website, you can use Web Intents. This documentation will help explain how to implement the intent:

https://dev.twitter.com/docs/intents#follow-intent

If that doesn’t answer your question, feel free to provide an example of your specific use case and we can make a recommendation based on that.


#6

Okay, thanks!

Which intent(s) do populate event.data, then?


#7

Follow events will return the data hash with a property for the user_id and screen_name that was followed. Retweet events will return the data hash with a property for the source_tweet_id (the tweet that was retweeted). Likewise, Favorite events will populate data.tweet_id to indicate which tweet was favorited.


#8

if the tweet count is 0, is it possible to hide the count? and only have it show up once there’s at least 1 tweet?


#9

We do not support this natively at this time, but an interesting idea for us to consider.

It’s not trivial, but you could show the Tweet Button with the parameter set as “data-count=none” so it doesn’t show the count. With our Javascript Event detection, you could detect when a Tweet is completed and store that value in your CMS. Then, you could show the Tweet Button with or without count based on that record in your CMS.

Event detection documentation: https://dev.twitter.com/docs/intents/events

Share counts are cached for 15 minutes, so keep that delay in mind when your CMS decides to show the count.


#10

I’ve been trying to implement a Tweet button, but the counter doesn’t get updated.
I know that you cache the count, but even tweets that I made the day before won’t show.

Here’s my code (sort of):
< a href=“http://twitter.com/share” class=“twitter-share-button” data-text=“Default text here” data-count=“horizontal” data-counturl=“http://www.mydomain.com/mypage/” >Tweet< /a >

Is there something I can do, or is it a problem on your side?


#11

I’m trying to implement the Tweet button intent event handler but nothing happens after I test post. A popup window appears for me to tweet. I tweet and it shows that I have tweeted and the window closes. No java “alert” executes afterwards like I want it.

Here’s something similar to what I have:

<div id=“twitter”>Tweet about ASDF on Twitter!</div>

<script type=“text/javascript” src=“http://platform.twitter.com/widgets.js”></script>

<a href=“http://twitter.com/share
    class=“twitter-share-button”
    data-url=“https://www.asdf.com
    data-counturl=“https://www.asdf.com
    data-text=“Check out ASDF at https://www.asdf.com
    data-count=“horizontal”>Tweet</a>

<script type=“text/javascript”>
    twttr.events.bind(‘tweet’, function(event) {
       alert(“tweet occurred”);
    });
</script>

Edit: The problem was me running the page “offline”. I needed to execute it on a local server or an online source.


#12

Hi on my http://meltronx.com/bb13/ website I have a Tweet Box that works great but I sure don’t like the plain vanilla Tweet Button for the tweet Box any suggestions on how to change the color , add a tweet bird?!


#13

Can i put in my web www.clubdeportivoazuqueca.com the letter of twitter so hight?


#14

Hi @RealFriscoKid,

You cannot change the color of the Tweet Button, but you can experiment with Web Intents to do some clever things with tweeting. It will take a little bit more development, but you can create a button that you style and power it with Web Intents. Take a look here:

https://dev.twitter.com/docs/intents

Also, for Twitter Logos, look here:

https://twitter.com/about/resources/logos

-Seth


#15

It looks like you put the profile widget in your site. You might consider styling the page differently to give the widget a placement that provides a different experience.


#16

Hi @andrew13nguyen,

Just a quick follow up, with the edit note you provided, may I assume that your problem is solved?

Seth


#17

As you mention, caching will cause a delay, but we have not seen many other reports of it not working. Have you see it fixed or is the problem persisting?


#18

Yes, thanks for following up


#19

http://www.fusiontweet.com/

The tweet button count doesnot update immediately… Why ? though the count updates after a certain period of time


#20

i am not a web publisher