Changeset 18067

Show
Ignore:
Timestamp:
08/22/08 19:04:56 (5 months ago)
Author:
mattn
Message:

:haiku!/ でpublic_timelineを表示する様修正

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/vimperator-plugins/trunk/haiku.js

    r18047 r18067  
    1111//  :haiku #keyword some thing text 
    1212//      post "some thing text" to keyword 'id:keyword' on hatena haiku. 
     13//  :haiku!/ 
     14//      show public timeline. 
    1315//  :haiku! someone 
    1416//      show someone's statuses. 
     
    5153        xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
    5254        xhr.send(null); 
    53         xhr.open("POST", "http://h.hatena.ne.jp/api/favorites/create/" + window.eval(xhr.responseText)[0].id + '.json', false, username, password); 
     55        xhr.open("POST", "http://h.hatena.ne.jp/api/favorites/create/" + evalFunc(xhr.responseText)[0].id + '.json', false, username, password); 
    5456        xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
    5557        xhr.send(null); 
     
    6062        xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
    6163        xhr.send(null); 
    62         xhr.open("POST", "http://h.hatena.ne.jp/api/favorites/destroy/" + window.eval(xhr.responseText)[0].id + '.json', false, username, password); 
     64        xhr.open("POST", "http://h.hatena.ne.jp/api/favorites/destroy/" + evalFunc(xhr.responseText)[0].id + '.json', false, username, password); 
    6365        xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
    6466        xhr.send(null); 
     
    6668    function showFollowersStatus(username, password, target){ 
    6769        var xhr = new XMLHttpRequest(); 
    68         var endPoint = target ? "http://h.hatena.ne.jp/api/statuses/user_timeline/" + target + ".json" 
    69             : "http://h.hatena.ne.jp/api/statuses/friends_timeline.json"; 
     70        var endPoint = target ? 
     71            target == "/" ? 
     72            "http://h.hatena.ne.jp/api/statuses/public_timeline.json" 
     73          : "http://h.hatena.ne.jp/api/statuses/user_timeline/" + target + ".json" 
     74          : "http://h.hatena.ne.jp/api/statuses/friends_timeline.json"; 
    7075        xhr.open("POST", endPoint, false, username, password); 
    7176        xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");