Took a few weeks off, first for school, and then for christmas. Back only a few days, and I’ve learned the basics about Cookies and Filters in ASP.NET MVC. They’re both pretty simple, even moreso than I thought. Instead of rewriting a lot of the stuff I read, I’ll just link to the StackOverflow answers that I used directly.
For the cookies, it’s here, where it shows both how to add and delete (via setting the Expiry of the cookie to yesterday) a cookie. I thought that was pretty neat. Basically all it is is a number that the browser stores, and then the server has to do something with that.
Which brings me to Filters, with a SO answer in two parts: Here and the offical docs, which are very surprisingly handy this time. Filters just run before and after certain events, like Authorization, Actions, Results and Exceptions. I’ve only played with “OnResultExecuting” which mean before the ViewResult has been finished being processed, since if I change the ViewBag in the filter, the returned view with contain the modified data.
Other than that, I’ve run into a strange issue which I’m really hoping to solve: the catalog index I got the from Netflix API is incomplete! It’s got about 56k titles on there, individual shows included as separate entries (something I still have to sort out) and I can’t find certain titles, like Dexter and The 4400, which are both available for streaming off Netflix.com. I’ve made a post asking for clarification here but looking at the post, it seems like I’ll need to cross post into the “Help me” subforum, rather than the “API forum” forum.
My buddy is still working on the Rotten Tomatoes thing, which has taken a few months now. He hasn’t made much progress as far entering things into the database, but then I realized that without the huge /catalog/titles/streaming resource, I’d probably be in the same spot he is. I’ll have to remind him about the OMDB tool, and how we can just pull the RottenTomatoes data from there instead. Then it’ll be a matter of associating the Netflix movie with the RottenTomatoes movie. That’ll be tricky.
Anyway wanted to make a post here because it’s been a while, and it doesn’t get any easier to write these. And although I now manage to get about 1000 people to the site a month, I realized 75%+ of them are here for the tutorials I have written. I really should keep working on those… If you ever have something you’d like to learn about, please hit me up!