Page 2 of 2

Dynamic Pages from REST

Posted: Mon Jul 07, 2014 8:32 pm
by Seth

Confused Ha...

So wait in Startscreen what value.id and value.imdb_id changing?

Meaning in the mapping like this? http://i.imgur.com/2Vni3Ym.png if so it still fails and doesn't work.

Screenshots are helpful if you can...


Dynamic Pages from REST

Posted: Tue Jul 08, 2014 2:55 am
by Yurii Orishchuk

Hi Seth,

You have this code which is should set "data-item-id" with value from item id.
http://prntscr.com/40hjxq/direct

pre

element.attr("data-item-id", value.Id);

/pre

But if you take a look on service response it does not provide "Id" field.
http://prntscr.com/40hke1/direct but does "imdb_id" and "tmbd_id"

So you need use:

pre

element.attr("data-item-id", value.imdb_id);

or

element.attr("data-item-id", value.tmbd_id);

/pre

Regards.


Dynamic Pages from REST

Posted: Tue Jul 08, 2014 5:21 pm
by Seth

Alright i changed the value to value.imdb_id ..
Do i change any of these?
console.log("id = " + $(this).attr("data-item-id"));

localStorage.setItem("itemId", $(this).attr("data-item-id"));


Dynamic Pages from REST

Posted: Tue Jul 08, 2014 5:30 pm
by Seth

I hate to keep being a burden... Can you re-evaluate my app please?
I changed it to value.imdb_id and set the request to imdb_id

But when i click on a movie it just shows "Noahs" url on any movie i click on. Hmm... I'm not sure where i am messing up.


Dynamic Pages from REST

Posted: Wed Jul 09, 2014 10:05 pm
by Yurii Orishchuk

Hi Seth,

I've checked your app and found next problem:

1 When you click on item on "Trending Movies" you save id from attribute "data-item-id" to LSV with name "itemId". http://prntscr.com/413jpn/direct

2 But on "About" page - you map id to request service parameter from "itemid". http://prntscr.com/413ker/direct

The problem is "itemid" not equal to "itemId". So you need to delete current link and add new one from "itemId" to "imdb_id" parameter on "About" page.

See details: http://prntscr.com/413lh1/direct

From now this will send to your "http://api.trakt.tv/movies/trending.j..." service parameter "imdb_id=tt2294629" with certain id.

But i guess this REST service dont support this fielter parameter. You need review this service and set correct id filter.

Also i've found some search api and here is it: http://api.trakt.tv/movie/summary.jso...

So you need to create service getMovie with following parameters: http://prntscr.com/413u8o/direct

Regards.


Dynamic Pages from REST

Posted: Fri Jul 11, 2014 3:56 am
by Seth

Thank you Yurri; Works perfect :-)