Coder Social home page Coder Social logo

Response impossible to treat about apai-io HOT 5 CLOSED

exeu avatar exeu commented on June 5, 2024
Response impossible to treat

from apai-io.

Comments (5)

Exeu avatar Exeu commented on June 5, 2024

can you please post the string which is returned from the request?

from apai-io.

toumz avatar toumz commented on June 5, 2024

Here's the code I used :

                    $conf = new GenericConfiguration();
                    $conf
                        ->setCountry('FR')
                        ->setAccessKey('XXX')
                        ->setSecretKey('XXX')
                        ->setAssociateTag('watamooviecom-21');


                    $search = new Search();
                    $search->setCategory('Video');
                    $search->setDirector($realfilm);
                    $search->setKeywords($nomfilm);
                    $search->setResponsegroup(array('Large'));

                    $apaiIo = new ApaiIO($conf);
                    $response = $apaiIo->runOperation($search);
                    //$movies = new SimpleXMLElement($reponse);
                    //echo $movies->movie[0]->Name;
                    echo $response;

Here's the beginnig of the string . It continues like this with all the attributes of "Large" responsegroup.
Thanks mate.

f7f23927-ebf1-48d2-937b-de30be132a970.1088370000000000TrueKevin MacdonaldThe Last King of ScotlandLargeVideo91http://www.amazon.fr/gp/redirect.html?camp=2025&creative=12742&location=http%3A%2F%2Fwww.amazon.fr%2Fgp%2Fsearch%3Fkeywords%3DKevin%2BMacdonald%2BThe%2BLast%2BKing%2Bof%2BScotland%26url%3Dsearch-alias%253Ddvd&linkCode=xm2&tag=watamooviecom-21&SubscriptionId=XXXXXXXUXYQB000QUUQEOhttp://www.amazon.fr/dernier-roi-dEcosse-Forest-Whitaker/dp/B000QUUQEO%3FSubscriptionId%3DAKILEA3XUXYQ%26tag%3Dwatamooviecom-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB000QUUQEOAdd To Wishlisthttp://www.amazon.fr/gp/registry/wishlist/add-item.html%3Fasin.0%3DB000QUUQEO%26SubscriptionId%3DAKPLEUXYQ%26tag%3Dwatamooviecom-21%26linkCode%3Dxm2%26camp%3D2025%26creative%3D12742%26creativeASIN%3DB000QUUQEOTell A

from apai-io.

Exeu avatar Exeu commented on June 5, 2024

It seems that your usage is wrong for this.
What you get here is a complete XML from Amazon according to the documentation.
See: http://docs.aws.amazon.com/AWSECommerceService/latest/DG/ItemSearch.html (at the end of the page).

If you try to access it like you do in the commented lines with the SimpleXMLElement it could not work.

You should do something like this:

(string) $movies->Items->Item[0]->ItemAttributes->Title

Please try to analyse the XML which is returned. You can copy it correclty if you view the source of your page and then paste it here and make yourself familiar with the usage of a SimpleXMLElement:
http://php.net/manual/de/simplexml.examples-basic.php.

from apai-io.

toumz avatar toumz commented on June 5, 2024

Yeah thanks it was the first time I use XML. Now it works like a charm :D
Great work mate !

from apai-io.

jonathanquehay avatar jonathanquehay commented on June 5, 2024

Hello Exeu, can do some step by step process of using the library apai-io I have two days to try to make you run and I have not accomplished.

from apai-io.

Related Issues (20)

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.