Customizing the Twitter button without using intents


I want to use the twitter buttons so they appear like the ones on this page: I need the look, and the count feature. I want exactly what the code below generates on a page:

<a href="" 
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);;js.src="";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

Except, I want it to go to a different link than the generated “…” I want it to go to a starting page I have set up that uses the oauth mechanism to format & send the tweet.

I’m kind of inferring that replacing the data-counturl with my content page url will let the api keep track of the count, but don’t know what the data-url attribute is supposed to represent.


You won’t be able to achieve this using Tweet Button resources ultimately – the counts aren’t provided as a public API. It’d also be unwise to provide an alternate experience with the Tweet Button that lead somewhere else – the Tweet Button user experience should be consistent wherever the Tweet Button is found.

If you want a user to use OAuth and authenticate your site to act on their behalf, then you should make that process clear and entirely separate from the Tweet Button product itself.


That’s disappointing. I’m actually doing little more than the default functionality of the button, from the process POV. The reason I need to go the custom route is so I can use the update_with_media API to embed an image with the tweet. Nothing more.