Gracenote php throwing HTTP RESPONSE ERROR - php

I'm trying to get Gracenote APi to work on my site. I got it working some months back but never went any further. I am using the same credintials that used back then when it worked and the php gracnote class from Rich Adams on github. I am trying to get the example file to work but am recieving this error.
Fatal error: Undefined class constant 'HTTP_RESPONSE_ERROR' in C:\wamp\www\Interface\php-gracenote-master\php-gracenote\HTTP.class.php on line 113
This is on my localhost atm. I tried it on my server aswell and it threw the same error.
I have made another app on Gracenote thinking they may have blocked the old one but that didn't help. Does gracenote block the entire account if it isn't active for some months or I am I just been a tool and missing something here?
EDIT
The issue seems to be when trying to register for a user id

This is caused when cURL returns an error code when trying to make the request to Gracenote's servers.
There was a bug in php-gracenote where HTTP_RESPONSE_ERROR wasn't defined, which is why you didn't get a human-friendly error message. I've just updated the code on GitHub, so you'll actually get a proper error now.
The exception will give you the cURL error code that was returned, which you can lookup in the libcurl error codes to see what the problem is. Could be anything from a DNS issue to an incorrect SSL version.
As far as I'm aware, Gracenote doesn't deactivate accounts for inactivity on the developer program. This may change in future though.

Related

Maps API using file_get_contents causes internal 500 error

I have been using the Maps API service for a month now. This morning I found that the service has stopped working. Any request to maps.googleapis.com causes my server to hang for a moment and then display the internal server 500 error.
At first I thought I was blocked / banned by google and there must be something I have overlooked with the t and c's but having looked further there are no notifications in my google api dev console.
If I make a request from another server using the same API key it works.
If I make a request directly in the url bar with the same API key it also works.
It only hangs and causes a 500 error for the domain maps.googleapis.com and not any other. I am guessing that Google has blocked my server IP but it seems odd that they would do this and my API key still works fine. If they had blocked me it wouldn't it be the whole API account?
Firstly, how do I know if I am blocked?
Secondly, why do I not get a error from google saying what the issue is?
Why does it cause my server to issue a 500 error? If my server is blocked it wouldn't just respond to say whatever the API problem is?
All seem very strange to me. It only started today. I am hitting the API with file_get_contents using php 5.1 on an apache server.
To clarify, the 500 error is on my server, I cannot see any response from the http request because it hangs and then spits out the 500 error.
And now after 3 hours of debugging it works for no explained reason. The only possibility that i can think of is that the hosting company has been doing maintenance and something they changed caused this. after waiting on hold for 20 minuts they disconnected but perhaps they looked into it behind the scenes for me. Pretty annoyed a whole morning waisted and although im happy it has resolved its still frustrating to not know what or why

Custom http methods on Cloud9-IDE

I've written some API code for a project of mine, on my local machine (Wampserver), there's no problem sending custom request methods, and the stack handles them the same as GET and POST.
In Cloud9, however, all the basic methods go to the application bootstrap (a PHP file), but custom method names, for example "GENERATE", which I totally made-up, is stopped before the PHP bootstrapper with the following message: "Something went wrong! Server timed out or sent incomplete response" with error code 502.
I attempted to investigate and fix it myself, but couldn't. I don't even know which behaviour (Wampserver or Cloud9) is the default expected behaviour.
Can anyone help? How do I tell Cloud9 instances to handle custom methods the same as regular ones?

CSRF Tokens appended to requests

I have an OpenCart shop running on two different servers (development and staging of the exact same site). On Server #1 everything is working as expected, but on Server #2 I'm all of a sudden seeing the parameter CSRF_TOKEN=xxxxxxx appended to various but not all URLs.
Where is this coming from???
For example, if I press the "Add to cart"-button jQuery throws the following exception:
Error: Syntax error, unrecognized expression: ?CSRF_TOKEN=xxxxxxx
I'm also getting a bunch of other errors, all due to this mysterious CSRF_TOKEN.
If I hover over certain links, I see the the CSRF_TOKEN as part of the URL but it's not in the source code but somehow ends up in client.
I´m running Apache version 2.2.29 and PHP 5.4.32. I have no idea where this is coming from or what to do about it - Any ideas on what is going on here?
My hosting provider confirmed that it was an security rule on the server causing the issue and helped me resolve it.

Google Analytic API general issues

In trying to follow the Hello Analytics API (https://developers.google.com/analytics/solutions/articles/hello-analytics-api) I have found many issues. I have downloaded it off github as described. The problem is: The API comes with errors itself. Firstly it has many internal (files from within the api to other files within the api) link errors. It does not link correctly to its other files. I was able to fix this
But, some functions that the class in the API provides are incorrect as well. There are errors that exist within the php files the api provides. Such as :
Call to undefined method Google_Http_Request::getItems().
This is due to a incorrect return type
In conclusion the API comes with errors within itself! How has anyone been able to use this API if it causes errors before it can even execute?
Did i download it from the correct location? (https://github.com/google/google-api-php-client)
Is there something causing an error with my server?
I dont understand how the API has errors by itself
Any help would be greatly appreciated.
I had the same problem.
The reason is that the function getItems return bad type in case it fails (http instead of list).

Facebook OAuth and the PHP SDK... errors

I'm working with Facebook login on my website and was looking at this example: https://github.com/facebook/php-sdk/blob/master/examples/example.php
When I hit "Login with Facebook" on the example site, I get an error:
An error occurred with PHP SDK Unit Tests. Please try again later.
Any ideas why this would happen?
I've tried it with their Javascript version and get an almost identical error (error with Mu Console...).
I haven't verified this myself but on their issue tracker there seems to be a similar, closed issue. https://github.com/facebook/php-sdk/issues/236
Whether this was closed as resolved or not isn't obvious from the description unfortunately.
I have had the error.
My solution was very simple. I've just check the app id and the other keys and I notice that they were bad. I have copied directly thes ones of the examples and this is why it didn't work.
Please, do just check again all the keys and be sure that they are ok.
I have used sdk 3.0.1, the last one it the time of writing this.

Categories