ThriftHunting

(Find - Scan - Price) - Find value in everyday items...

Welcome Guest Search | Active Topics | Members | Log In | Register

User-Agent HTTP header question/idea Options
brownj00
Posted: Friday, April 17, 2009 8:47:43 PM

Rank: Member
Groups: Member

Joined: 3/20/2009
Posts: 14
Points: 42
[figured if I was going to right a book (oops) I should move this to a better topic area so it doesn't clutter the New People area...]

On the HTTP header, (BTW I do want to try out the mobile version page with my new phone/PDA...)

I meant what your "backend" query sends to Amazon/Half, etc. to get the price- not about your Mobile site version responds to me with.

I am only semi-literate when it comes to website coding, so I will try and outline what I think in case anybody else reads this later it will hopefully makes some sense. Real code monkeys will see the errors in what I say though I'm sure. Here goes.

Some sites (like here!) have a mobile version page you can get when you request the right path (e.g. www.site.com\mobile or ...\pda).

Some other major websites (Google, Amazon, etc.) automatically detect when you are on a phone or PDA and they return their mobile version as appropriate (you don't ask for the special ...\mobile URL but you get it anyway).

As I understand it, they do this because each browser inserts several invisible bits (headers) into the HTTP request it sends to the server- they announce what browser version they are- and the website application is programmed to respond differently for mobile versions. Many of us have heard of the HTTP GET (ask for data) and HTTP POST (put data) but there are plenty of other headers too. I saw this... http://en.wikipedia.org/wiki/List_of_HTTP_headers and I think the "User-Agent" tag is the one I am thinking of.

When we use a regular browser like Firefox you can't change what headers it sends- it's all automatic and invisible. But if somebody is writing a program or routine to go pull info from another website... well, I think you can code your bot or whatever to send any headers you want to program in.

Then I looked and found this... http://www.ericgiguere.com/articles/masquerading-your-browser.html which describes what I mean pretty close. It shows how to monkey with these even for standard browsers too... looks like there is all kind of stuff when I googled for "mobile browser detection".

So if your program sends the request to Amazon (and the others?) and you embed the User-Agent header with a mobile version ID (like Windows CE?) then Amazon automatically replies to you with a simplified "mobile" version result- instead of the cluttered normal page. The mobile version of Amazon does not have all the images, ads, etc. the normal page has. I think as a result of that, the answer you want in our case here (just the $$) comes back to you faster. Not that the site seems slow... it's certainly faster than I can type in a UPC code (or probably scan it). But it occurred to me to wonder if that kind of think could possible speed up a List Batch search.

So... I'm curious, what you think? I know there is always a major danger to "clever ideas" when I don't know enough about something- it only seems clever because I don't know enough to see why it is idiotic. I know this may not apply at all to the way you actually execute those backend queries, but I got kind of curious when I saw this great thing.

[[ I was thinking of trying to work something up (or have one of my code monkey friends help me figure out how to do it) that I could run on my desktop that would pull ALL the Amazon Used prices for ONE item (not just the lowest price) and report several things like Average, how much the 5th and 10th listings were (ranked by cost like cheapest to most expensive), by Conditions, etc.. What I find is the lowest Used price might be for "Used-Acceptable" condition with say a cracked case and no manual- and be $5... when the 2nd listing is for "Used-Good" and is $20. More common is some CD's are listed for .01 (cheapest) but there is only 2-3 at that price and then it jumps to $6 (fourth listing) and higher. That affects whether I should buy an item for $1!... or if I did whether I should donate it or list it. It just takes 2-3 minutes per item to really check the listing prices in depth, and evaluate it but... multiplied by a box of 50 CD's... So it occurred to me to wonder if this technique might be useful to me. But if it's not a good idea, I want to understand a little "why not"... so maybe then I could try something better. Trying to go mobile with this seems to daunting though. Part of why I think this site is awesome!]]

Hope that makes more sense. Probably just put everybody to sleep though. *<80)

LuckyScanner
Posted: Monday, April 20, 2009 12:16:16 PM

Rank: Administration
Groups: Administration

Joined: 1/25/2008
Posts: 33
Points: 74
Hello brownj00-

Thanks for all the input you're giving Angel

So I guess I'll get right to it as this might be a lengthy response, hehe.


The backend part of the "hunter" utility doesn't actually download any images when performing the parsing operation so a User-Agent header wouldn't change how the utility works really. Thanks for your input though. If the backend did actually have to download images and such that would be an interesting way to optimize the utility.

For the utility pulling other information such as average price, 5th listing, etc. Well that is a long story which I'll sum up here I guess. Before the online version of the utility I had made several iterations of a destkop application that pulled all kinds of information. The process worked but also took a bit of time to actually compute (it was just more complicated programming-wise).

I used the desktop application constantly and was always modifying/optimizing it to better suit what I needed while out on the hunt. After awhile I came to the conclusion that the only item I really looked at was the minimum price. I had other info but when looking at the average price I never knew what I was getting sometimes. Sure it was an average price of $14 but then it would end up being 90% of the items listed for $1-$2 with some signed/rare copies by two or three individuals throwing the average price off quite a bit (I guess you could say that information was helpful but couldn't be trusted all the time).

So basically after several iterations of the utility I found that I wanted to "keep it simple". My intention, after some field work and programming was that I needed an online application that would quickly "flag" items of interest. If I wanted to investigate the item more I could (thus the feature of having the price link directly to the actual item on the website). I also found that if given minimum prices from three different sites I wouldn't really need an average price. If all three returned low prices, regardless of condition, then I knew that item was widely available for anyone looking to buy it and I would move on. If the utility returned a mix-up of prices (two high and one low for example) then I could investigate that item more if I wanted. The whole key was to keep it simple and be able to flag items of interest quickly.

Hmm...so kind of lengthy...but not too bad Angel

Thanks,
LuckyScanner
brownj00
Posted: Thursday, September 03, 2009 12:05:25 PM

Rank: Member
Groups: Member

Joined: 3/20/2009
Posts: 14
Points: 42
Hi again,

So I reread your reply and can see your point. And as always a simple goal helps make for a simple (and supportable) design. That's a principle I try and use at work as well...

On a related quest... kind of follows up on this idea. I am looking at maybe trying Excel web queries if I want to have a "tracking board" for a short list of video games. Maybe track the top 20 sellers in each category, etc. kind of thing which is a little different than what the tool here is supposed to do. If I get crazy I might try and pull the same kind of data from Amazon, Ebay, Gamestop, etc. for arbitrage between platforms? Just a crazy idea for my spare time...

Here is the best example of what I posted earlier. Amazon has this URL which only returns the simplified "mobile" page results. You can see the results similar to my original idea for "http header browser version" instantly.

http://www.amazon.com/gp/aw/

I am certain Excel will be faster grabbing the details through this URL/method- it's not necessarily how fast Excel could "ignore" the influx of data on the regular page... but as this method provides so much less data from the site itself it comes through much faster. I imagine the database lookups are so much simpler on their end. Pop in the UPC and presto the data comes back immediately, and using that URL approach is easier than trying to post headers (not sure Excel can do that).

So that should work good for my purpose for my little experiment... just food for thought.


Cheers,
John
LuckyScanner
Posted: Wednesday, September 16, 2009 4:14:10 PM

Rank: Administration
Groups: Administration

Joined: 1/25/2008
Posts: 33
Points: 74
Hey John-

Aww...I see what you were trying to point out with the "http header browser version" for speeding up the search. Yes, you are correct that even though the backend of the hunter utility isn't downloading the images directly, downloading a "mobile" version of the page would definitely decrease the amount of information that needed parsing.

When first developing the parsing utility I looked into retrieving just the "mobile" information but found that the product page didn't actually contain the information I needed. Now coming back to it, and checking out the Amazon mobile results page you have listed above, I see the mobile version does in fact have what I need! Thanks for pointing this out and reminding me that I should probably check back in with mobile search pages. I'll probably update the utility to take advantage of this in hopes of getting a little more speed from the search results and also having a cleaner parsing mechanic :-)

Thanks again,
LuckyScanner
Users browsing this topic
webmaster


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Modified Version of SoClean Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.7 (NET v2.0) - 11/20/2007
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.
This page was generated in 0.181 seconds.