Coder Social home page Coder Social logo

ttsweb / phptvdb Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 2.33 MB

Automatically exported from code.google.com/p/phptvdb

JavaScript 2.92% PHP 68.06% Groff 0.09% HTML 9.68% CSS 2.10% Batchfile 0.19% Smarty 15.23% Shell 0.09% TeX 1.52% Visual Basic 0.12%

phptvdb's People

Contributors

ryandoherty avatar

Watchers

 avatar

phptvdb's Issues

Fix for Find_by_Id

thetvdb.com appearently changed one of the URLs used to find a show by its
ID number. An API key is no longer needed. Here are the changes I made to
TVDB/TV_Shows.class.php

I added 

CONST tvdbUrl = 'http://thetvdb.com/';

just above 

CONST tvdbUrl = 'http://thetvdb.com/';


and then I changed a line in request so it looks like this now

protected function request($params) {

      switch($params['action']) {

        case 'show_by_id':
          $id = $params['id'];
          $url = self::tvdbUrl.'data/series/'.$id.'/';

          $data = self::fetchData($url);
          return $data;
        break;


it's the $url line that I changed.

I had previous changed by code using the fixes listed on the issues list before

Original issue reported on code.google.com by [email protected] on 24 Mar 2009 at 12:38

TV_Shows::search

Currently the search can take a long time and puts extra strain on
thetvdb.com by getting the data multiple times here:

    $xml = simplexml_load_string($data);

    foreach($xml->Series as $show) {
        $shows[] = self::findById((string)$show->seriesid);
    }

This is the different pages it downloads of thetvdb
http://thetvdb.com/api/GetSeries.php?seriesname=24
http://thetvdb.com/api/################/series/76290
http://thetvdb.com/api/################/series/79848
http://thetvdb.com/api/################/series/73012
http://thetvdb.com/api/################/series/76047
http://thetvdb.com/api/################/series/74238
http://thetvdb.com/api/################/series/84312

In my case I had the error:
Show Not Found! 
Cause

but that's caused because it seems to use
http://thetvdb.com/data/series/76290/
now


But if it was changed to:

    $xml = simplexml_load_string($data);

    foreach($xml->Series as $show) {
        $shows[] = new TV_Show($show);
    }

It only has to get 
http://thetvdb.com/api/GetSeries.php?seriesname=24

Ok it misses some data but for selection you shouldn't need all the data

At least change it so you have to enable getting all data eg:

search($showName, true) which would get all data

Original issue reported on code.google.com by [email protected] on 13 Mar 2009 at 1:42

get all episodes

/**
         * Get all episodes by show id
         * 
         * @return array an array of TV_Episodes 
         **/
         public function getAllEpisodes() {
            $params = array('action' => 'get_all_episodes',
                            'show_id' => $this->id);

            $data = self::request($params);

            if($data) 
            {
                $xml = simplexml_load_string($data);
                $episodes = array();
                foreach($xml->Episode as $episode) 
                {
                    $episodes[] = new TV_Episode($episode);
                }
                return $episodes;
            } 
            else 
            {
                return false;
            }
        }

Original issue reported on code.google.com by [email protected] on 12 Apr 2012 at 5:54

Problem with getEpisodeByDate()

What steps will reproduce the problem?
I used a simple bit of code to test it.

    include('TVDB.php');


        $tvShows = TV_Shows::findById('75978'); 
        $tvEpisode = $tvShows->getEpisodeByDate('20090308');

        echo $tvEpisode->name;


What is the expected output? What do you see instead?

Fatal error: Call to a member function getEpisodeByDate() on a non-object
in /home/usenettv/public_html/test/test.php on line 24


What version of the product are you using? On what operating system?
Hosted on a linux server.

Please provide any additional information below.

I'm not sure whats changed since I last used this function. 

Thanks


Original issue reported on code.google.com by [email protected] on 13 Mar 2009 at 10:56

$tvShow->getEpisode method doesn't work

Run the example code at http://www.ryandoherty.net/php-tvdb/ and you will
reproduce the 'Trying to get property of non-object' error when trying to
use the getEpisode method. As far as I can trace it the request function in
tvdb.class.php doesn't return anything when $params['action'] =
'get_episode' in v1.0.2


Original issue reported on code.google.com by [email protected] on 17 Jun 2009 at 5:55

getSeason broken

TV_Show::getSeason is returning episodes not TV_Episode objects.





Original issue reported on code.google.com by [email protected] on 19 Oct 2012 at 11:03

enable gzip

add to TVDB::fetchData

curl_setopt($ch, CURLOPT_ENCODING, "");


to enable gzip and speed up downloads



Original issue reported on code.google.com by [email protected] on 19 Oct 2012 at 11:04

New Class, Seasons,

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 20 Jan 2010 at 11:50

Code changed? No results

What steps will reproduce the problem?
1. Download and install fresh copy of files
2. Run example from Ryans Website

I have downloaded and install a fresh copy of the files. I have added my
API key. I then create a blank file and insert the following PHP example
from your website.

<?php
    include('TVDB.php');

    //Returns array of TV_Show objects matching 
    //'Battlestar Galactica'
    $tvShows = TV_Shows::search("Battlestar Galactica"); 

    $tvShow = $tvShows[0];

    //'Battlestar Galactica (2003)'
    echo $tvShow->seriesName;

    //array('Edward James Olmos', 'Grace Park')
    print_r($tvShow->actors); 

    //Fetch a specific episode. getEpisode($season, $episode)
    $tvEpisode = $tvShow->getEpisode(2, 11);

    //'Resurrection Ship (1)'
    echo $tvEpisode->name; 

    //'The Battlestars Galactica and...'  
    echo $tvEpisode->overview; 
?>


This results in the following error


Fatal error: Call to a member function getEpisode() on a non-object in
/home/usenettv/public_html/test2/index.php on line 17


I've been having a few problems with the code recently. The search by ID
function seems to be broken. The search by name function also seemed broken
but was fixed after changing my code, as outlined by Issue 2.

Using this method isn't as precise however, it also doesn't pull as much
information as search by ID does.





Original issue reported on code.google.com by [email protected] on 17 Mar 2009 at 12:21

TV_Shows::search($showname) is echoed with flush();

What steps will reproduce the problem?
1. when "$tvShows = TV_Shows::search($showname);" the returned xml is
echoed when doing an "ob_flush(); flush();"?

What is the expected output? What do you see instead?
expected to see nothing

What version of the product are you using? On what operating system?
1.0.2

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 2 Jun 2009 at 1:04

Strict Standards

I downloaded version 1.0.3 and had the following errors:
Strict Standards: Non-static method TVDB::fetchData() should not be called 
statically in C:\xampp\htdocs\TVDB\TVDB.class.php on line 100
and
Strict Standards: Non-static method TVDB::request() should not be called 
statically in C:\xampp\htdocs\TVDB\TV_Shows.class.php on line 41

You have to add static to both function and everythink is fine.
In file TVDB.class.php in line 74 and line 47

Happens only if you have all errors on!

Original issue reported on code.google.com by [email protected] on 23 Apr 2012 at 12:33

Object of class TV_Show could not be converted to string

In a simple example of search method, give me the error:

Catchable fatal error: Object of class TV_Show could not be converted to string 
in /hermes/bosweb/web247/b2474/ipg.mateusdalpicom/projects/teste/index.php on 
line 7

my code:
require 'TVDB.php';
$shows = TV_Shows::search('LOST');
echo $shows[0];

Original issue reported on code.google.com by [email protected] on 12 Feb 2011 at 8:41

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.