Ajax request to marked episodes status

Cecile wrote 9 years ago: 1

Hi!

I'm working on my userscript and i'm stuck.

I have tried to mark an episodes as acquired using ajax with the url "http://www.tvmaze.com/watch/set?episode_id=" + i, and data : { type : t } ; i being the id and t the value of the select. But it doesn't work.

I also tried with api.tvmaze, with the same result.

A little help?


gazza911 wrote 9 years ago: 1

Where are you running the script?

And did you make sure to use the value rather than Watched, Acquired or Skipped

For example this is all you'd need for Acquired (with no error checking and the script running on a page on TVMaze)

$.post("http://www.tvmaze.com/watch/set?episode_id=" + i, { "type" : "1"});

Cecile wrote 9 years ago: 1

Yes, i'm running the script on the watchlist page and I got the value. Here the line:

$.ajax({
method: "POST",
url: "http://www.tvmaze.com/watch/set?episode_id=" + i,
data : { type : t }
});*/

Cecile wrote 9 years ago: 1

For other user who may encounter this issue : it was caused by a new resquest of jquery source.

If you create a userscript, don't import jquery; you can use it with the version already running on the site.

Try 30 days of free premium.