Welcome, Guest. Please login or register.
August 20, 2008, 05:08:20 PM

Login with username, password and session length
Search:     Advanced search
Website Baker 2.7.0 (stable) veröffentlicht!
Nähere Informationen findet ihr hier.
Das Diskussionsboard findet ihr hier.
60556 Posts in 9791 Topics by 5824 Members
Latest Member: blubb
* Home Help Search Login Register
+  Website Baker Community Forum
|-+  English
| |-+  Archive
| | |-+  Amazon Module development
Pages: [1] 2 3 Go Down Print
Author Topic: Amazon Module development  (Read 5318 times)
snipe
Apprentice Baker
***
Offline Offline

Posts: 62

SelfishHarpy
WWW
« on: January 19, 2006, 10:39:16 AM »

Hi gang,

I spent a few hours tonight working through the Amazon.Com XML and figuring out how to return what I want.  I am using the single product call XML, for reasons explained in a moment - you can see how it works here:
http://www.snipe.net/indigo/books.php

The actual product display row is controlled via a template, so it should be nice and easy to customize.

I have NOT worked on the admin at ALL yet, so this is more of a discussion about an upcoming module than anything else.

The plan is this:

In the admin, have a form allowing the user to paste in an ASIN/ISBN.  The script will then contact Amazon.Com, asking for the appropriate XML response, and then parse the data, inserting it into mySQL, including (but not necessarily limited to): product name, publisher, authors, image, list price, new price, used price

The affiliate url is automagically generated, and the admin settings will (hopefully) have several configurable options, such as amazon tld, admin defined categories, Amazon affiliate ID (required), Amazon Subcription ID (required), what size image to display, and whether or not to show all fields (like used prices, etc).

The good news is that the messiest part is over.  The bad news is that I haven't dealt with the WB administration aspects of the modules yet, so I have a little code searching to do. Smiley

I'll update as I make progress - feel free to post ideas or requests, though no promises tht requests will be handled for the first release.
Logged

kweitzel
Forum Team
A Baker's Baker
*****
Offline Offline

Posts: 4214


WWW
« Reply #1 on: January 19, 2006, 11:01:15 AM »

way to go snipe .. looking forward to the module ...

cheers

Klaus
Logged

snipe
Apprentice Baker
***
Offline Offline

Posts: 62

SelfishHarpy
WWW
« Reply #2 on: January 19, 2006, 11:08:20 AM »

Thanks Klaus Smiley  Necesssity is the mother of invention, and it happens that I need an amazon module - and since no one has written one yet.....

Some other ones I have in mind are:
  • Random quotes module
  • Glossary module

I know there are more, but I am too pooped to remember them

That said - I need to take a break and go to bed now - I have to work in 4 hours. shocked
Logged

bhhenry
Apprentice Baker
***
Offline Offline

Posts: 51



WWW
« Reply #3 on: January 19, 2006, 11:10:02 AM »

I like to keep a "Reading List" on my personal site of what I have read, am reading, and plan to read. The admin defined categories would would be great for that.

It would also help to be able to add properties for each book, for example a text field for a mini-review.

Thanks for the good work!  smiley
Logged
snipe
Apprentice Baker
***
Offline Offline

Posts: 62

SelfishHarpy
WWW
« Reply #4 on: January 19, 2006, 11:14:14 AM »

Thanks for reminding me!  One of the config options I was considering is to 1) include the amazon.com description 2) include an admin-defined text description or 3) both.

I'll have to see how progress goes - I'd like to get a working module finished by the end of the week, but it may not have all the bells and whistles mentioned here.
Logged

snipe
Apprentice Baker
***
Offline Offline

Posts: 62

SelfishHarpy
WWW
« Reply #5 on: January 19, 2006, 11:15:42 AM »

I also need to look into Amazon's error responses, so that I can provide a graceful error message if the ASIN/ISBN can't be found.
Logged

bupaje
Geek-Like Baker
*****
Offline Offline

Posts: 401


WWW
« Reply #6 on: January 19, 2006, 10:21:09 PM »

Hey one of my requests wohoo! Smiley I tried mucking around with that and changing it from the old token system to the new subscription ID but I'm not a coder so just wasted several hours.

On the error response how about redirecting to a page with the amazon search box and/or maybe related searches -ie. if visitor searches for an art book from my site and it gets an error return a page with search box and a 'you may like these related books'
Logged

snipe
Apprentice Baker
***
Offline Offline

Posts: 62

SelfishHarpy
WWW
« Reply #7 on: January 19, 2006, 10:44:02 PM »

The user will never run into an Amazon.Com error - only the admin creating the book record will.  When the admin enters and ISBN/ASIN number, the administration module will grab the corresponding info from Amazon and insert it into the mySQL table - so the only time the module ever talks to Amazon is that first time when it's gathering info, and even then, that's really just to save the admin from having to copy+paste a bunch of details about the product they want to display.  Do you see what I mean?

I started using Indigo as a basis for the app, but honestly, the code is pretty messy and the Amazon.Com array structure has changed since they released it, so it's not a good core to use anyway. I am using their XML parsing class, just because its easier than writing one from scratch, but that's the only part that's worth salvaging.
Logged

bupaje
Geek-Like Baker
*****
Offline Offline

Posts: 401


WWW
« Reply #8 on: January 19, 2006, 11:11:41 PM »

Ahhh, thanks for the explanation. There are some other popular ones here http://www.chipdir.nl/amazon/ and I had used them briefly on an old site -worked well- but they all use the token system as well and I couldn't figure out how to fix that and make them work with WB.

I am using CaRP http://www.geckotribe.com/rss/carp/ to insert some amazon on my site http://www.stormvisions.com and their is a free version - paid one is pretty cheap as well. It doesn't offer pagination and I don't know how to code it -I like CaRP overall just want to add a fuller store for music, books and software.

Logged

snipe
Apprentice Baker
***
Offline Offline

Posts: 62

SelfishHarpy
WWW
« Reply #9 on: January 19, 2006, 11:21:18 PM »

I typically use Magpie for RSS feed display, but whatever works is alright Smiley  The idea behind this is that the Amazon.Com RSS only comes into play during the initital creation, and then it relies on mySQL to actually store and display product info to the user.  I prefer this for one of a few reasons, not the least of which being that if Amazon.Com's services are ever down, you don't end up with errors displaying on your site, etc.  It also *seems* to me that Amazon would prefer you not access the RSS a bazillion times a day, but I could be wrong about that. Their AWS site isn't particularly helpful in some respects.  Plus, it looks like some of their webservices are paid, and if they ever transition into a "you pay for x number of RSS accesses", that could be a real drag.  So using this method, mySQL handles all the dirty work and the RSS is only involved at all to make administering the bookstore easier.  (If the admin RSS cannot find the book while it's being created in the admin, I will have to have the ability to enter in your own text as well.
Logged

bupaje
Geek-Like Baker
*****
Offline Offline

Posts: 401


WWW
« Reply #10 on: January 20, 2006, 12:23:11 AM »

Sounds great, I am down to try this when it is ready - thanks.
Logged

snipe
Apprentice Baker
***
Offline Offline

Posts: 62

SelfishHarpy
WWW
« Reply #11 on: January 20, 2006, 04:19:07 AM »

Can anyone who uses a non-us version of amazon.com's affiliate program post an affiliate product url or two, so I can see the syntax?

I have tested the code I have so far, and it works fine with non-book products:

http://www.snipe.net/indigo/books.php?asin=B0001CKSIG
http://www.snipe.net/indigo/books.php?asin=B00068EDUY

(The empty fields will not be displayed in the finished module.)
Logged

snipe
Apprentice Baker
***
Offline Offline

Posts: 62

SelfishHarpy
WWW
« Reply #12 on: January 21, 2006, 07:39:35 AM »

Can anyone who uses a non-us version of amazon.com's affiliate program post an affiliate product url or two, so I can see the syntax?

Anyone?  Anyone?  Bueller?  Bueller?  I don't have a non-US affiliate account, so I need some help with this. 

I have finished the admin module - all that's left is the public display, testing international settings, and rechecking the installation since I have madew a few changes to the tables.
Logged

kweitzel
Forum Team
A Baker's Baker
*****
Offline Offline

Posts: 4214


WWW
« Reply #13 on: January 21, 2006, 08:31:37 AM »

sorry, don't have an affiliate account yet .... but give some time ...
Logged

snipe
Apprentice Baker
***
Offline Offline

Posts: 62

SelfishHarpy
WWW
« Reply #14 on: January 21, 2006, 10:46:03 AM »

Okay, this module is effectively done - you can see the public demo here:
http://www.snipe.net/content/php_stuff/books.php

I installed and uninstalled, then reinstalled, and everything seems to be working okay - all except for the help file, which is mysteriously blank.  As soon as I get that sorted I'll upload the module for your enjoyment.
Logged

kweitzel
Forum Team
A Baker's Baker
*****
Offline Offline

Posts: 4214


WWW
« Reply #15 on: January 21, 2006, 10:56:58 AM »

it looks great!

Have signed up for a partner account. Then I am going to test your module ... again, give me some Tie for testing please ...

cheers

Klaus
Logged

snipe
Apprentice Baker
***
Offline Offline

Posts: 62

SelfishHarpy
WWW
« Reply #16 on: January 21, 2006, 11:32:08 AM »

All set - the completed module thread is here:
http://forum.websitebaker.org/index.php?topic=2294
Logged

bupaje
Geek-Like Baker
*****
Offline Offline

Posts: 401


WWW
« Reply #17 on: January 22, 2006, 06:31:27 AM »

Hey snipe, thanks for this. Doesn't seem to install correctly for me. It does add a page and the settings main page is there but no settings available and I get "Table 'wb.wbmod_amazon' doesn't exist"

Thanks for your work on this.
Logged

snipe
Apprentice Baker
***
Offline Offline

Posts: 62

SelfishHarpy
WWW
« Reply #18 on: January 22, 2006, 07:17:32 AM »

What do you have set as your WB table prefix in your settings?  And did the other tables create successfully?
Logged

snipe
Apprentice Baker
***
Offline Offline

Posts: 62

SelfishHarpy
WWW
« Reply #19 on: January 22, 2006, 07:22:38 AM »

I think I found the bug - uninstall that version and install this one, and let me know if it works OK
« Last Edit: January 22, 2006, 07:29:56 AM by snipe » Logged

Pages: [1] 2 3 Go Up Print 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!