Customize Tweet Button And Re-Direct


#1

I am trying to customize the Tweet button, but still use the atributes and have the browser redirect after the post has been made. When I try to remove the twitter-share-button class, since I do not want to use the default button, the atributes do not work. And I know how to fix that, I would include them in the URL. Correct?

But the browser does not redirect if I remove that class. Please, any help would be greatly appreciated.

I am using the following code.

<div id="tweet-btn">
<a href="http://twitter.com/share" class="twitter-share-button"
data-url="http://www.mysite.com"
 data-text="This is my custom message"
 data-count="none">Tweet This</a>
</div><!-- tweet-btn -->

with the following javascript

<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<script type="text/javascript">
 twttr.events.bind('tweet', function(event) {
       alert("Post Successful");
       window.location = "http://www.url-to-redirect-to.com"
    });
</script>

#2

anybody?


#3

If you want to customize the Tweet Button in this way, you’ll have an easier time using the Tweet Web Intent instead. You’ll need to use parameters instead of HTML attributes to declare your configuration, though: https://dev.twitter.com/docs/intents#tweet-intent


#4

Thanks Taylor. I was looking at that before. And customizing the button, and having it post a default message was not the problem. The problem was having it also re-direct after the tweet was made.

I was able to do this with Tweet Web Intent. But it does not work when I customize the buttona nd remove the twitter-share-button class.


#5

I don’t understand to this


#6

I NOW UNDERSTOOD THIS A LITTLE BIT BUT HOW DOES IT WORK


#7

do web intents allow you to show the count of messages? If not it would be a good feature request. That way I can have a customized button and show all the information possible.

Maybe there is already and API to get the count?


#8

There’s no element for intents to show the count of messages nor a public API for you to obtain the count from. The only way to get the count is to use the full-on Tweet Button at this time.


#9

@avexretweet thnx dude its working.


#10

s2wy is here let them talk think wiser!!!


#11

in case someone still looking

https://dev.twitter.com/discussions/671


#12

#13