2011-09-26 17 views
2

は、私は自分のサイト上のアイテムに関する情報を取得するためのStumbleUponのAPIで動作するようにしようとしています。StumbleUponのAPIのURLエンコードの問題

ドキュメント:http://www.stumbleupon.com/help/badge-api-documentation/

今ではいくつかのURLの場合を除き完璧に動作します...例えば

しかしhttp://lolbin.net/i/fp16jU82/that's-what-beer-is-for.htmはStumbleUponのAPIの問題であるURLに 'を有します。

私はいろいろなことを試してみましたが、私はエラーページを取得しておいてください。

http://www.stumbleupon.com/services/1.01/badge.getinfo?url=http://lolbin.net/i/fp16jU82/that's-what-beer-is-for.html 

http://www.stumbleupon.com/services/1.01/badge.getinfo?url=http://lolbin.net/i/fp16jU82/that\'s-what-beer-is-for.html 

http://www.stumbleupon.com/services/1.01/badge.getinfo?url=http://lolbin.net/i/fp16jU82/that%27s-what-beer-is-for.html 

http://www.stumbleupon.com/services/1.01/badge.getinfo?url=http://lolbin.net/i/fp16jU82/that%252527s-what-beer-is-for.html 

項目が多くのビューですでにStumbleUponのデータベース内にある:私の質問は、私は照会することができるか、であるhttp://www.stumbleupon.com/url/lolbin.net/i/fp16jU82/that%252527s-what-beer-is-for.html

私は有効なリターンを得るためにAPIを介してこの特定のアイテムですか?

答えて

2

それは%で2527の

http://www.stumbleupon.com/services/1.01/badge.getinfo?url=http://lolbin.net/i/fp16jU82/that%2527s-what-beer-is-for.html 

戻り動作します:

{"result":{"url":"http:\/\/lolbin.net\/i\/fp16jU82\/that%27s-what-beer-is-for.html", 
"in_index":true,"publicid":"Aq9jhK","views":262882, 
"title":"Thats what beer is for - LOLBIN.net","thumbnail":"http:\/\/cdn.stumble-upon.com\/mthumb\/767\/82718767.jpg", 
"thumbnail_b":"http:\/\/cdn.stumble-upon.com\/altbthumb\/767\/82718767.jpg","submit_link": 
"http:\/\/www.stumbleupon.com\/submit?url=http:\/\/lolbin.net\/i\/fp16jU82\/that%27s-what-beer-is-for.html","badge_link": 
"http:\/\/www.stumbleupon.com\/badge?url=http:\/\/lolbin.net\/i\/fp16jU82\/that%27s-what-beer-is-for.html", 
"info_link":"http:\/\/www.stumbleupon.com\/url\/lolbin.net\/i\/fp16jU82\/that%252527s-what-beer-is-for.html"}, 
"timestamp":1317025970,"success":true} 

Godiusは、二重のURLエンコードを指摘したように、それは、あります。 '=>%27 =>%2527

+0

ありがとうございました。物事を二度読み取ればそれはうまくいった。 –

+0

あなたの質問では、URL ['%27']をシングルエンコーディングし、それを二重エンコーディングするのではなく、トリプルエンコーディング['%252527']しようとしたのは奇妙です。いつもあなたが試した最後のことです。 – Cheeso