aboutsummaryrefslogtreecommitdiffstats
path: root/twitter.js
diff options
context:
space:
mode:
authortrapezoid2008-09-14 09:27:10 +0000
committertrapezoid2008-09-14 09:27:10 +0000
commit1b61cb57a5fa31a5a522f064f971b822467aa0f9 (patch)
tree54dcbf943d4675b11b6beb005f7a04dabd8c7ff3 /twitter.js
parente8c5a3ba7ed45b1a92b677ba6abe47a0b8382e8e (diff)
downloadvimperator-plugins-1b61cb57a5fa31a5a522f064f971b822467aa0f9.tar.bz2
twitter.js: revert to prev
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@19286 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'twitter.js')
-rw-r--r--twitter.js51
1 files changed, 1 insertions, 50 deletions
diff --git a/twitter.js b/twitter.js
index 4cb165f..7dfbf03 100644
--- a/twitter.js
+++ b/twitter.js
@@ -1,5 +1,5 @@
// Vimperator plugin: "Update Twitter"
-// Last Change: 29-Aug-2008. Jan 2008
+// Last Change: 20-Jun-2008. Jan 2008
// License: Creative Commons
// Maintainer: Trapezoid <trapezoid.g@gmail.com> - http://unsigned.g.hatena.ne.jp/Trapezoid
//
@@ -137,55 +137,6 @@
.replace(/(?:\r?\n|\r)[ \t]*/g, " ");
liberator.echo(html, true);
}
- var services = {
- 'twitter': {
- description:'Twitter',
- account:['https://www.hatena.ne.jp', 'https://www.hatena.ne.jp', null],
- loginPrompt:{ user:'', password:'', description:'Enter username and password.' },
- entryPage:'http://b.hatena.ne.jp/entry/%URL%',
- poster:function(user,password,url,title,comment,tags){
- var tagString = tags.length > 0 ? '[' + tags.join('][') + ']' : "";
- var request =
- <entry xmlns="http://purl.org/atom/ns#">
- <title>dummy</title>
- <link rel="related" type="text/html" href={url}/>
- <summary type="text/plain">{tagString + comment}</summary>
- </entry>;
- var wsse = new WSSEUtils(user,password);
-
- return Deferred.http({
- method: "post",
- url: "http://b.hatena.ne.jp/atom/post",
- data: request.toString(),
- headers: {
- "X-WSSE": wsse.getWSSEHeader(),
- "Content-Type": "application/atom+xml",
- },
- }).next(function(xhr){
- if(xhr.status != 201) throw "Hatena Bookmark: faild";
- });
- },
- tags:function(user,password){
- var xhr = new XMLHttpRequest();
- var hatena_tags = [];
-
- xhr.open("GET","http://b.hatena.ne.jp/my",false);
- xhr.send(null);
-
- var mypage_html = parseHTML(xhr.responseText, ['img', 'script']);
- var tags = getElementsByXPath("//ul[@id=\"taglist\"]/li/a",mypage_html);
-
- tags.forEach(function(tag){
- hatena_tags.push(tag.innerHTML);
- });
- liberator.echo("Hatena Bookmark: Tag parsing is finished. Taglist length: " + tags.length);
- return hatena_tags;
- },
- icon:function(url){
- return '<img src="http://b.hatena.ne.jp/entry/image/' + url + '" style="vertical-align: middle;" />';
- },
- }
- };
liberator.commands.addUserCommand(["twitter"], "Change Twitter status",
function(arg, special){
var password;