Changeset 34083
- Timestamp:
- 06/21/09 21:46:38 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/retweet.js
r34069 r34083 4 4 <name>retweet</name> 5 5 <description>ReTweet This Page.</description> 6 <description lang="ja"> $B3+$$$F$$$k(BTweet$B$r(BReTweet$B$7$^$9!#(B</description>6 <description lang="ja">開いているTweetをReTweetします。</description> 7 7 <author mail="from.kyushu.island@gmail.com" homepage="http://iddy.jp/profile/from_kyushu">from_kyushu</author> 8 <version>0. 1</version>8 <version>0.2</version> 9 9 <license>GPL</license> 10 10 <minVersion>1.2</minVersion> … … 34 34 { 35 35 var body = $U.getFirstNodeFromXPath("//span[@class='entry-content']").innerHTML; 36 var tags = body.match(/<.*?>/g); 37 for(tag in tags) 36 //return body.replace(/<[^>]*>/g, ""); 37 var tags = body.match(/<[^>]*>/g); 38 for(var tag in tags) 38 39 { 39 40 body = body.replace(tags[tag],""); … … 50 51 { 51 52 var xhr = new XMLHttpRequest(); 52 var req = "http://bit.ly/api?url=" + longUrl;53 var req = "http://bit.ly/api?url=" + encodeURIComponent(longUrl); 53 54 xhr.open('GET',req, false); 54 55 xhr.send(null); 55 if (xhr.status != 200)56 if(xhr.status != 200) 56 57 { 57 58 return longUrl; … … 64 65 var xhr = new XMLHttpRequest(); 65 66 var statusText = "RT @" + name + " [" + url +"]: " + body; 66 xhr.open("POST", "http ://twitter.com/statuses/update.json", false, username, password);67 xhr.open("POST", "https://twitter.com/statuses/update.json", false, username, password); 67 68 xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 68 69 xhr.send("status=" + encodeURIComponent(statusText) + "&source=Vimperator"); 69 70 liberator.echo("[RT] Your post was sent. ");70 71 liberator.echo("[RT] Your post was sent."); 71 72 } 72 73 … … 88 89 sendTwitter(url,name,body); 89 90 } 90 else if (liberator.globalVariables.twitter_username && liberator.globalVariables.twitter_password)91 else if(liberator.globalVariables.twitter_username && liberator.globalVariables.twitter_password) 91 92 { 92 93 username = liberator.globalVariables.twitter_username;
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)