happylinks / TVCalendar

Creates calender-file with your favorite TV-show airdates.
http://thetvdb.com
5 stars 3 forks source link

Blank page only #2

Open renne opened 8 years ago

renne commented 8 years ago

TVCalendar shows only a blank page. This is also the case with [http://happylinks.nl/TVC/index.php?accountid=](http://happylinks.nl/TVC/index.php?accountid=your account identifier).

happylinks commented 8 years ago

What is your account identifier? My url works correctly: http://happylinks.nl/TVC/index.php?accountid=2480663E57D3E853

happylinks commented 8 years ago

I turned error reporting on and get an error that the xml doesn't exist. So maybe your account identifier is wrong? Warning: file_get_contents(http://www.thetvdb.com/api/8BD63BCCA8872351/series/315714/all/en.xml): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/w4126469/domains/happylinks.nl/public_html/TVC/index.php on line 34

happylinks commented 8 years ago

Mm, it's not your account identifier, maybe it's a serie that returns an error. I'll try to add error handling.

happylinks commented 8 years ago

Ok it should work now, serie number "8" returned a 404. Fixed it here: https://github.com/happylinks/TVCalendar/commit/72342c01785d6e46294ec31b666e0dc06d5b804a Let me know if it works!

renne commented 8 years ago

The series has been deleted from TheTVDB and can't be removed from the favorites.

Your webservice works fine. When I call my one I only get BEGIN:VCALENDAR PRODID:-//TVCalendar 1471942732//EN VERSION:2.0 END:VCALENDAR I've placed the API-key in "apicode.txt" in the same directory like the index.php.

happylinks commented 8 years ago

Your accountid works on my server, can you log all errors you get? Or maybe log the response of the favorites call? Maybe the api key isn't correct yet?

renne commented 8 years ago

The problem are line-breaks.

Replace $apicode = file_get_contents("apicode.txt"); with $apicode = trim(file_get_contents("apicode.txt"));

Alternatively you can use a function which removes all non-alphanumeric characters from $apicode. ;-)

I suggest checking all inputs ($apicode, $_GET["accountid"]) for correct format (alphanumeric characters only).