Facebook can't scrape my site correctly - PHP Site - facebook

I am running this website www.miswag.net which is highly dependent on Facbeook. When I share my site on Facebook, I get a "403 Forbidden", here's Facebook's debugger output when I try to scrape my site: https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.miswag.net
Please help figure this out.. Thanks

Facebook's scraper doesn't need to read the full page, so they only request part of it by sending a Range header. However, your server seems to be responding incorrectly to that request and returning a 403 error code. You need to check your server and make sure it handles the range header correctly.
To see this in action, try this CURL command:
curl -H "Range: bytes=0-524287" http://www.miswag.net
This is the response I got:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /
on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>

Compounding on #Waleed'sanswer, if you want to test right away, use Online CURL
fill in www.wiswag.net
ADD OPTION options, choosing --header (-H)
next to it "Range: bytes=0-524287"
CURL button

Related

AMP form amp_source_origin error cors header

I am getting error in AMP Form
<form class="innler-left" method="post" action-xhr="//mydoma.com/ xxxx/xxx/xxx/send.php" target="_top">
On submit getting below error in console.
Response must contain the AMP-Access-Control-Allow-Source-Origin header
Form submission failed: Error:
Response must contain the AMP-Access-Control-Allow-Source-Origin header​​​ _reported_
Once user submit the form it goes it php file in where I put the following header
header('HTTP/1.1 200 OK');
header("access-control-allow-credentials:true");
header("AMP-Same-Origin: true");
header("Access-Control-Allow-Origin:".$_SERVER['HTTP_ORIGIN']);
header("amp-access-control-allow-source-origin: https://".$_SERVER['HTTP_HOST']);
header("Access-Control-Expose-Headers: AMP-Access-Control-Allow-Source-Origin");
header("access-control-allow-headers:Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token");
header("access-control-allow-methods:POST, GET, OPTIONS");
header("Content-Type: application/json");
I got it working offline on local machine but once i upload files, it not working :(
tried https://github.com/ampproject/amphtml/blob/master/spec/amp-cors-requests.md
POST __amp_source_origin is not matching!
I was also facing the same issue to fix this, make sure your URL start with https. And try to replace the following line in your code :
header("Access-Control-Allow-Origin:".$_SERVER['HTTP_ORIGIN']);
with
header("Access-Control-Allow-Origin: ". str_replace('.', '-','https://www.example.com') .".cdn.ampproject.org");
Note : Replace https://www.example.com with your AMP website URL
Hope it helps.

Mailchimp No Host Exception when Subscribing Email to A List

I'm trying to send a subscription call, but got an error saying the the URL is invalid.
This is the URL I used:
https://us14.api.mailchimp.com/3.0/lists/<list-id>/members/
then I get this back in the response:
<HTML>
<HEAD>
<TITLE>Invalid URL</TITLE>
</HEAD>
<BODY>
<H1>Invalid URL</H1>
The requested URL "http://%5bNo%20Host%5d/3.0/lists/41e44e1bde/members/", is invalid.
<p>
Reference #9.cc6a1db8.1483891456.16189371
</BODY>
</HTML>
which translates to:
http://[No Host]/3.0/lists/<list-id>/members/
us14 is definitely the right data center according to the documentation so I'm not quite sure what's wrong.
It turned out that if you set HTTP header field "Host" in the request, it will always return this error. I tested this out by removing every fields one-by-one and this was the only one that caused an issue.
Many environments use the Host header for stuff like virtual sites where you are running more than one website behind the same IP Address (i.e. api.mailchimp.com and www.mailchimp.com could be on the same server) It is definitly possible for an error to be received if you set an invalid host since their proxies can't route it correctly. Normally, the host header is set automatically by the browser or HTTP client and usually not something you would override.
Are you still having trouble? If so, would be useful to see a screenshot of something like PostMan or https://ApiRequest.IO to see what your inputs are.

Zephyr API to access test steps not working

I need to access test steps of a test case.
When I tried the following URL using CURL GET request,
http:///rest/zapi/latest/teststep//
I am getting the following error message
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved here.</p>
<hr>
<address>Apache/2.4.7 (Ubuntu) Server at <jira_server> Port 80</address>
</body></html>
Same request using the browser gives {}
I got the issue ID using the REST API
"https:///rest/api/2/issue/testCaseId
So I am sure that the issue Id is correct.
Is this something because of latest zephyr update?
Can some one help me what is the issue with the request?
Unfortunately I think you have to purchase a plugin to use the ZAPI:
https://marketplace.atlassian.com/plugins/com.thed.zephyr.zapi
You can, however, connect to your database yourself and try to extract the test steps by looking for a table called [SOME_PREFIX_SUCH_AS_A7AEFBD]_TESTSTEP in your jira database. It holds an ID for the issue it belongs to so combining it with the jiraissues table you can fetch all test steps for a test issue you've made. Put that query result into an excel sheet and you have yourself a cheap extraction of your test steps.

Could Not Follow Redirect Path

I was debugging open graph for my new website and I have the following error:
Could Not Follow Redirect Path
and
URL returned a bad HTTP response code.
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.webcilento.com%2Fsite%2Feventi%2Ffiera-di-prova.html
This error occurs only in calendar section (http://www.webcilento.com/site/eventi/fiera-di-prova.html)
I'm using Joomla 3.2.1
Any ideas?
I think there is an error in the og:url open graph header which you have set.
The URL to your page is http://www.webcilento.com/site/eventi/fiera-di-prova.html but the open graph header says this:
<meta property="og:url" content="http://www.webcilento.com/site/site/eventi/fiera-di-prova.html" />
There is an extra "site/" part in that URL - Facebook is picking this up, visiting that URL which then returns a 404 - hence the "bad HTTP response code" message. If you change that <meta> to the following, it should work:
<meta property="og:url" content="http://www.webcilento.com/site/eventi/fiera-di-prova.html" />
If these headers are added by a plugin or by Joomla itself, then perhaps something is misconfigured? If you provide more information about how you are adding the Open graph headers to the page then we can assist with that.
What acute view! I haven't seen the double 'site' in the url!
Anyway the tag is added by a calendar plugin.
This is the code
// adding current url as url
if (isset($_SERVER['HTTPS'])) {
$protocol = "https://";
} else {
$protocol = "http://";
}
$fburl = $protocol.$_SERVER['HTTP_HOST'].KRequest::root().#route('option=com_ohanah&view=event&id='.$event->id.$itemid);
$doc->addCustomTag( '<meta property="og:url" content="'.$fburl.'" />');
I'll try to debug that variables.
After digging for 3 days came to the conclusion that name servers were configured incorrectly.
I am using Bigrock for the domain and GoDaddy for hosting, by mistake, I configured actual hosting provider host name in "Name Server 3" and "Name Server 4". But Facebook looks for the content in first server "bigrocks-1.com"(wrong server) server but does not find any hosting. Bigrock redirects request to next server "bigrocks-2.com", for which Facebook results into 'Using data from "URL" because there was an error following the redirect path.'.
Hope it may help you :)

Facebook Device Flow Support

According to the Facebook docs, OAuth Device Flow is supported.
However, when I follow their directions on starting the Device Flow process, I receive a status code of 400 (Method not implemented).
Has anyone successfully able to get the Facebook Device Flow process functioning?
curl -X post https://graph.facebook.com/oauth/device?type=device_code&client_id={appId}
<HTML>
<HEAD>
<TITLE>400 Bad Request</TITLE>
</HEAD>
<BODY>
<H1>Method Not Implemented</H1>
Invalid method in request<P>
</BODY>
</HTML>
About your specific error, it seems facebook docs made you do it wrong: FAIL
You must send a POST request, which you're asking cURL to do, but request data must not be part of the URL. Instead, you should use the -d option to specify the sent data and use the URL up to the ? sign, like shown in this superuser question
But! Even if you used the right HTTP method, you'd get an error that reads:
Unsupported type: 'device_code'. Supported types: web_server, user_agent, client_cred, username
Now the best part: this happens unless you use the client_id facebook themselves used for their demo! In that case, you get a 200 (OK) response with the expected code, user_code and verification_uri. Apparently their application is somehow different from those we're trying with. No hint in the app configuration page about this.
By the way, I haven't found anyone claiming to have successfully used facebook's Device Flow, have you?
Here's an example implementation, but I haven't managed to get it working with my own project:
https://oauth-device-demo.appspot.com/
I also encountered the same error.
look this article
http://forum.developers.facebook.net/viewtopic.php?id=105132
it's teach your how set app, but after trying, nothing change~
you can try~