ripper234 / Whatever-Origin

An open source alternative to AnyOrigin.com (this project is looking for a maintainer)
http://whateverorigin.org/
320 stars 74 forks source link

Request 404 error #17

Closed koddr closed 8 years ago

koddr commented 9 years ago

Hello.

I try code in my script (js):

$.getJSON('http://whateverorigin.org/get?url=' + encodeURIComponent('https://widgets.getpocket.com/v1/button?count=horizontal&url=' + location.href) + '&callback=?', function(response) {
  console.log(response.contents);
});

But Google Chrome console always return this response.contents (i.e. error page):

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /v1/button?count=horizontal&amp;url=http://mysite.com was not found on this server.</p>
<hr>
<address>Apache Server at widgets.getpocket.com Port 80</address>
</body></html>

If change your URL to http://anyorigin.com/dev/get?url= then show right request:

<html>
<head>
<link rel="stylesheet" type="text/css" href="https://d7x5nblzs94me.cloudfront.net/v1/c/button.css?v=6" />
<script type="text/javascript" src="https://d7x5nblzs94me.cloudfront.net/v1/j/shared.js?v=2"></script>
</head>
<body>

<div class="widget horizontal pocket left">
    <a id="btn">
                <!-- 
        Please do not scrape this for the Pocket count. 
        It is not relible for you to use and will likely change. 
        Contact us at api@getpocket.com for an official API. 
        Thanks! 
        -->
        <span><em id="cnt">1</em><i></i><u></u></span>
                <b></b>
    </a>
</div>

<script type="text/javascript">
var POCKET_DOMAIN = 'getpocket.com';
var iLi = false;

var btnData = {"mode":"viapocketbutton","ct":"00394812dab479a2e02fddb28bc37f113c5f18da","ctn":"b04a68245e730401ebb4ab8c55ce873bf5fb9c4a","label":"pocket","count":"horizontal","src":"","url":"http:\/\/mysite.com"};
</script>
<script type="text/javascript" src="https://d7x5nblzs94me.cloudfront.net/v1/j/button.js?v=5"></script>
</body>
</html>

Whats wrong? Help me please, if you can!