oAuth授权后使用数据

时间:2012-07-07 22:04:21

标签: javascript jquery oauth twitter twitter-oauth

我在oAuth授权后使用数据时遇到了麻烦。所以我通过Javascript oAuth库授权我的Twitter Streaming api:

var url = "https://stream.twitter.com/1/statuses/filter.json";
    var accessor = {
        token: "69848552-B6geQZCA8ttirQIMKrIk47SOE541V7d5ZcYwEBUqQ",
        tokenSecret: "MY_TOKEN_SECRET",
        consumerKey: "BKsXdR3SO4hSZyFT2JevHQ",
        consumerSecret: "MY_CONSUMER_SECRET"
    };

    var message = {
        action: url,
        method: "POST",
        parameters: {
            track: "cocacola",
            locations: "-180,-90,180,90",
        }
    };

OAuth.completeRequest(message, accessor);
OAuth.SignatureMethod.sign(message, accessor);
url = url + '?' + OAuth.formEncode(message.parameters);

然后我尝试提出请求(在示例中解释):

jQuery(function(tweets) {
            tweets.post(url, {
                tweets: {
                    'Latlng': tweets("#geo.coordinates").val(),
                    'text': tweets("#text").val(),
                }
        }, function(tweets) {
            setMarkers(tweets);
            },
            "json"
        );
    });

通过jQuery库。但Firebug说我的申请是未经授权的。我究竟做错了什么? 请帮帮我吧。

0 个答案:

没有答案
相关问题