2

Stumbleupon APIを使用して、自分のサイトのアイテムに関する情報を取得しようとしています。

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

これで、一部のURLを除いて完全に機能します...

ただしhttp://lolbin.net/i/fp16jU82/that's-what-beer-is-for.htm、たとえば、URLに'が含まれている場合、これはStumbleuponAPIの問題です。

さまざまなことを試しましたが、エラーページが表示され続けます。

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を介してこの特定のアイテムをクエリして、有効な返品を取得するにはどうすればよいですか?

4

1 に答える 1

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}

ゴディウスが指摘したように、それは二重のurlencodingです。'=>%27 =>%2527

于 2011-09-26T08:36:25.173 に答える