#1 2006-12-12 21:52:52

mihailis
New member
From: Louisville, KY
Registered: 2006-12-12
Posts: 6

Modifying Amazon search returns.

I've been looking at modifying the GCbooks template to add some specific fields that I'd like to track on my books.  I figured out how to add them in the /GCModels/GCbooks.gcm file, but I'm kind of stuck with the GCAmazon.pm search plugin.  Is there an easy way to add fields to scrape?  I've got very little experience with Perl, so the commands in the file look familiar but as a whole I can't make out how to modify it.

Offline

 

#2 2006-12-13 07:35:49

Tian
Administrator
From: France
Registered: 2006-12-08
Posts: 1647
Website

Re: Modifying Amazon search returns.

Hello,

The quick answer is that it is not so easy and you will need to write some code for this.

The plugins are some event-based HTML parsers. That means they will go through an HTML page and some functions will be called when some events occured.

When a tag (such as <p> or <a href=...>) starts, the method called is start
When there is some textual content, the method called is text
When a tag ends, the method called is end

Inside these methods, there are 2 main blocks depending on the value of $self->{parsingList}.

If this is a true value, that means we are parsing a results page (the list of items that match a query).
If this is a false value, we are parsing the information for a given item.

Then when some information are extracted for an item, they have to be stored in $self->{curInfo}->{fieldName}, where fieldName is the same name as the one in the .gcm file.

Could you please let me know what are the fields you'd like to add. I could give you more information then or maybe implement them when time permits.

Offline

 

#3 2006-12-15 04:37:59

mihailis
New member
From: Louisville, KY
Registered: 2006-12-12
Posts: 6

Re: Modifying Amazon search returns.

Yeah, I'm way out of my depth on that one.  Really, the only other field I was wanting to capture was the "List Price" and that's just so that I could use it to tabulate the total cost of the collections.  If it would be a lot of trouble to add into the program, I can enter those values in by hand since I have to have the books out to grab the ISBNs anyway.  smile

GCstar is a really nice package, by the way.  I've been looking for a long time for just this type of program to catalog all of my manga.

Offline

 



Should you have a problem using GCstar, you can open a bug report or request some support on GCstar forums.