Romulus (romulusnr) wrote,
Romulus
romulusnr

So I was peeking at my StyleFeeder page today. StyleFeeder is a site that some old friends of mine work for, and it is based on this principle: given the set of things you own or want, you can extrapolate more things you want from the set of all things. (Let's just accept this postulate for now; I've got issues with it, or at least their application of it so far, but TNHNT.)

So, you create a "feed" of things you own or want via the site; for example there is a nifty FF plugin that you can use when you are on any common e-commerce site's product page and it will near-automagically import that item into your feed. In addition to this, they have a feature on the website which you can look up your Amazon wish list, and it will be imported into your feed.

Well, the page doesn't work. Not in FF or IE, due to JS errors.


Warning: Empty string passed to getElementById().
Error: $ is not defined
Source File: http://www.stylefeeder.com/amazon-wishlist.html
Line: 34


Well, I figured, if the form is sound, I can look at the source, find the form, follow its action and the form inputs, and generate a query. Well, in Web 2.0 we don't simply use a form to send values via GET; we use a form to send values to a JavaScript function to send a GET. So instead of a FORM ACTION there's a FORM OnSubmit.

OK, so look at the whole page source and find the function -- hopefully its not buried in a slew of referenced .js files. No, it's there: function wishlistLookup(pagenumber). This calls another function, which determines whether the value you enter into the textbox is your name, or your email address. It does this by determining whether or not your text had an @ in it. (John Sm@th is out of luck.) It takes 10 lines to do this, btw.

The wishlistLookup() function goes on to take the result of this determination, which the backend is apparently unable to figure out on its own, and the value itself, and pass it to the backend. The result looks something like this:

Find your Amazon wishlist below:
(Not available) preview
Bob123 preview
(Not available) preview
Bobby44 preview
BobDobbs preview
(Not available) preview
(Not available) preview
UncleBob preview

OK, so this is a list of matches on the text "Bob" which does not have an @ symbol so it searched by name. Each name has a link next to it so you can see the actual wishlist and make sure it's actually yours.

Remember now, though, that this is Web 2.0, and links aren't actually links that will take you places, but things to click on that will trigger onClick() actions that call JavaScript functions... that will take you places. (Fuck, why do we even bother with web browsers? We should just run JavaScript interpreters and write JavaScript functions to do all the things that we used to need browsers for!)

Anyway. I looked up that function, and determined its GET call, and managed to get an XML dump of my Amazon wishlist. Still, because I'm not wrapped in the right DIV on the original page (Web 2.0 strikes again!), I haven't actually gotten to the step where I can actually import the wishlist, which was my intention. But I've figured out a lot.


What annoys me about all this is not so much the Web 2.0 supercriticality, or the fact that the page doesn't work, but that I can figure out all that, yet still haven't gotten a new job, in a field where most people in it wouldn't have had any idea where to start on this.
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 1 comment