Jump to content

Help me develop **retweet** button


Recommended Posts

 

tweetmeme website has a button called "retweet" which could be inserted on any webpage of any site. You just need to insert this script on your page.

 

<script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script>

 

When this button is clicked from your website it connects with twitter, takes your twitter credentials, takes the title and link to your webpage and inserts in that twitter account.

Inserting could be done with another xml api which I have.

 

I just need help from PHPfreak Guru's and others to develop the same button script on my website. Then lets say phpfreaks.com can call my site using this script and my site allows it to insert tweet and give a count.(same like tweetmeme)

 

 

Link to comment
Share on other sites

 

At this link

http://tweetmeme.com/i/scripts/button.js

 

the code present is

(function(){var _url=window.location.href;
var _url=_url.replace(/((?:\?|&)?fbc_receiver=.+)?(?:#.*)?$/,"");
var url=escape((typeof tweetmeme_url=="string")?tweetmeme_url:((typeof TWEETMEME_URL=="string")?TWEETMEME_URL:_url)).replace(/\+/g,"%2b");
var source=(typeof tweetmeme_source=="string")?escape(tweetmeme_source)(typeof TWEETMEME_SOURCE=="string")?escape(TWEETMEME_SOURCE):false);var style=(typeof tweetmeme_style=="string")?escape(tweetmeme_style)(typeof TWEETMEME_STYLE=="string")?escape(TWEETMEME_STYLE):"normal");
var service=(typeof tweetmeme_service=="string")?escape(tweetmeme_service)(typeof TWEETMEME_SERVICE=="string")?escape(TWEETMEME_SERVICE):false);
var service_api=(typeof tweetmeme_service_api=="string")?escape(tweetmeme_service_api)(typeof TWEETMEME_SERVICE_API=="string")?escape(TWEETMEME_SERVICE_API):false);
var alias=(typeof tweetmeme_alias=="string")?escape(tweetmeme_alias)(typeof TWEETMEME_ALIAS=="string")?escape(TWEETMEME_ALIAS):false);
var src="http://api.tweetmeme.com/button.js";
switch(style){case"compact":var h=20;var w=90;break;case"rednose":var h=61;var w=50;break;default:var h=61;var w=50;break}src+="?url="+url;src+="&style="+style;if(source!=false){src+="&source="+source}if(service){src+="&service="+service}if(service_api){src+="&service_api="+service_api}if(alias){src+="&alias="+alias}document.write('<iframe src="'+src+'" height="'+h+'" width="'+w+'" frameborder="0" scrolling="no"></iframe>');
tweetmeme_url=null;TWEETMEME_URL=null;
tweetmeme_source=null;
TWEETMEME_SOURCE=null;
tweetmeme_service=null;
TWEETMEME_SERVICE=null;
tweetmeme_service_api=null;
TWEETMEME_SERVICE_API=null;
tweetmeme_style=null;
TWEETMEME_STYLE=null})();

 

Now when you call this function using a script

<script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script>

 

It inserts a button(app 100X100 px) on your webpage...

 

Now instead on tweetmeme people should be able to call

http://MYSITE.com/i/scripts/button.js

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.