;ò = ÄDc@scdkZdkiZdkTdkiZdkiZdki Z de i fd„ƒYZ e Z dS(N(s*sAmazoncBs¢tZeZdgZdgZd„Zd„Zd„Zd„Z e e e hdd<ƒd gƒZ d „Z e e e hdd<ƒd gƒZ d „Z e e e hdd<d d<d d<ƒd gƒZ d„Ze ee hdd<ƒd gƒZd„Ze ee hdd<ƒd gƒZd„Ze ee hdd<ƒd gƒZd„Ze ee hdd<dd<dd<ƒd gƒZd„Ze ee hd d<dd<d d<dd<ƒd gƒZd„Ze ee hd d<dd<d d<dd<ƒd gƒZd„Ze ee hdd<dd<dd<dd<dd<dd<dd<ƒd gƒZd„ZeeƒZRS(NsWebs amzSnarfercCs&tt|ƒ|_|ii|ƒdS(N(ssupersAmazonsselfs_Amazon__parents__init__sirc(sselfsirc((s./Amazon/plugin.pys__init__+scOsLy |ii|||||ŽWn%ti j o}|i dƒnXdS(NsñYou must have a free Amazon web services license key in order to use this command. You can get one at . Once you have one, you can set it with the command "config supybot.plugins.Amazon.licensekey ".( sselfs_Amazon__parents callCommandsnamesircsmsgsLskwargssamazons NoLicenseKeyseserror(sselfsnamesircsmsgsLskwargsse((s./Amazon/plugin.pys callCommand/s cCsøh}g}d}t|tiƒo |g}nx»|D]³} yRx™|i ƒD]‹\} } t | | dƒ||   "  cCsAt}x+|D]#\}} |djo t}q q W|iddƒiddƒ}hdd<dd<d d <d d <d d<}d} |i d}|id|ƒ}|id|ƒ}yYti|d|ƒ} |i| || ||ƒ} | o|itd| ƒƒdSnWntij o } nX|idƒdS(s¸[--url] Returns the book matching the given ISBN number. If --url is specified, a link to amazon.com's page for the book will also be returned. surls-ss s ProductNamestitles Manufacturers publishersAuthorssauthorsOurPricespricesURLsU%(title)s, written by %(author)s; published by %(publisher)s; price: %(price)s%(url)sisboldsregionslocales%LNs!No book was found with that ISBN.(sFalsesurlsoptlistsoptionsargumentsTruesisbnsreplacesattribssssmsgsargsschannelsselfs registryValuesboldsregionsamazonssearchByKeywordsbooks _genResultssressircsreplysformats AmazonErrorse(sselfsircsmsgsargssoptlistsisbnsattribssoptionsurlsressargumentsssbooksesregionschannelsbold((s./Amazon/plugin.pysisbnZs*  3  surlsstextcCs#t}x+|D]#\}}|djo t}q q Whdd<dd<dd<dd <d d<}d } |i d } |i d | ƒ}|i d| ƒ}yYti|d|ƒ} |i| || ||ƒ} | o|itd| ƒƒdSnWntij o } nX|idƒdS(sÃ[--url] Returns the books matching the given search. If --url is specified, a link to amazon.com's page for the book will also be returned. surls ProductNamestitles Manufacturers publishersAuthorssauthorsOurPricespricesURLsU%(title)s, written by %(author)s; published by %(publisher)s; price: %(price)s%(url)sisregionsboldslocales%LNs-No books were found with that keyword search.(sFalsesurlsoptlistsoptions_sTruesattribssssmsgsargsschannelsselfs registryValuesregionsboldsamazonssearchByKeywordskeywordsbookss _genResultssressircsreplysformats AmazonErrorse(sselfsircsmsgsargssoptlistskeywordsattribssoptionsurlsressssbooksschannelsesregions_sbold((s./Amazon/plugin.pysbooks|s(  3  cCsGt}d} x1|D])\} }| djo t}q| } qWhdd<dd<dd<d d <d d <d d<dd<}d}|i d} |i d| ƒ}|i d| ƒ}y_ti|d| d|ƒ}|i|||||ƒ} | o|itd| ƒƒdSnWntij o } nX|idƒdS(só[--url] [--{dvd,vhs}] Returns the videos matching the given search. If --url is specified, a link to amazon.com's page for the video will also be returned. Search defaults to using --dvd. sdvdsurls ProductNamestitles Manufacturers publishers MpaaRatingsmpaasMediasmedias ReleaseDatesdatesOurPricespricesURLsm%(title)s (%(media)s), rated %(mpaa)s; released %(date)s; published by %(publisher)s; price: %(price)s%(url)sisregionsbolds product_lineslocales%LNs.No videos were found with that keyword search.(sFalsesurlsproductsoptlistsoptions_sTruesattribssssmsgsargsschannelsselfs registryValuesregionsboldsamazonssearchByKeywordskeywordsvideoss _genResultssressircsreplysformats AmazonErrorse(sselfsircsmsgsargssoptlistskeywordsattribssvideossboldsresschannelsproductsoptionses_surlsregionss((s./Amazon/plugin.pysvideoss.    E   sdvdsvhscCs/t}x+|D]#\}}|djo t}q q W|iddƒiddƒ}hdd<dd<d d<}d } |i d } |id | ƒ}|id | ƒ}yYti|d|ƒ} |i| || ||ƒ} | o|itd| ƒƒdSnWntij o } nX|idƒdS(s¸[--url] Returns the item matching the given ASIN number. If --url is specified, a link to amazon.com's page for the item will also be returned. surls-ss s ProductNamestitlesOurPricespricesURLs"%(title)s; price: %(price)s%(url)sisregionsboldslocales%LNs!No item was found with that ASIN.(sFalsesurlsoptlistsoptions_sTruesasinsreplacesattribssssmsgsargsschannelsselfs registryValuesregionsboldsamazons searchByASINsitems _genResultssressircsreplysformats AmazonErrorse(sselfsircsmsgsargssoptlistsasinsattribssoptionsurlsressitemssschannelsesregions_sbold((s./Amazon/plugin.pysasinÄs*  !  cCs8t}x+|D]#\}}|djo t}q q W|iddƒiddƒ}hdd<dd<d d <d d<}d } |i d } |id| ƒ}|id| ƒ}yYti|d|ƒ} |i| || ||ƒ} | o|itd| ƒƒdSnWntij o } nX|idƒdS(s^[--url] Returns the item matching the given UPC number. If --url is specified, a link to amazon.com's page for the item will also be returned. Only items in the following categories may be found via upc search: music, classical, software, dvd, video, vhs, electronics, pc-hardware, and photo. surls-ss s ProductNamestitles Manufacturers manufacturersOurPricespricesURLs3%(title)s %(manufacturer)s; price: %(price)s%(url)sisregionsboldslocales%LNs No item was found with that UPC.(sFalsesurlsoptlistsoptions_sTruesupcsreplacesattribssssmsgsargsschannelsselfs registryValuesregionsboldsamazons searchByUPCsitems _genResultssressircsreplysformats AmazonErrorse(sselfsircsmsgsargssoptlistsupcsattribssoptionsurlsressitemssschannelsesregions_sbold((s./Amazon/plugin.pysupcãs*  *  cCs#t}x+|D]#\}} |djo t}q q Whdd<dd<dd<dd <d d<}d } |i d }|i d |ƒ}|i d|ƒ}yYti|d|ƒ} |i| || ||ƒ} | o|itd| ƒƒdSnWntij o } nX|idƒdS(s¾[--url] Returns a list of books written by the given author. If --url is specified, a link to amazon.com's page for the book will also be returned. surls ProductNamestitles Manufacturers publishersAuthorssauthorsOurPricespricesURLsU%(title)s, written by %(author)s; published by %(publisher)s; price: %(price)s%(url)sisregionsboldslocales%LNs#No books were found by that author.(sFalsesurlsoptlistsoptionsargumentsTruesattribssssmsgsargsschannelsselfs registryValuesregionsboldsamazonssearchByAuthorsauthorsbookss _genResultssressircsreplysformats AmazonErrorse(sselfsircsmsgsargssoptlistsauthorsattribssoptionsurlsressargumentsssbookssesregionschannelsbold((s./Amazon/plugin.pysauthors(  3  cCsKt}t} x1|D])\} } | djo t}q| } qW| pd} hdd<dd<dd<d d <d d <d d<}d}|i d} |id| ƒ}|id| ƒ}y_ti|d| d|ƒ}|i|||||ƒ}|o|itd|ƒƒdSnWntij o } nX|idƒdS(só[--url] [--{music,classical}] Returns a list of items by the given artist. If --url is specified, a link to amazon.com's page for the match will also be returned. The search defaults to using --music. surlsmusics ProductNamestitles Manufacturers publishersArtistssartistsMediasmediasOurPricespricesURLsY%(title)s (%(media)s), by %(artist)s; published by %(publisher)s; price: %(price)s%(url)sisregionsbolds product_lineslocales%LNs#No items were found by that artist.(sFalsesurlsNonesproductsoptlistsoptions_sTruesattribssssmsgsargsschannelsselfs registryValuesregionsboldsamazonssearchByArtistsartistsitemss _genResultssressircsreplysformats AmazonErrorse(sselfsircsmsgsargssoptlistsartistsattribssboldsresschannelsproductsoptionses_surlsitemssregionss((s./Amazon/plugin.pysartist`s0     <   smusics classicalcCsTt}d} x1|D])\} } | djo t}q| } qW| pd} hdd<dd<dd <d d <d d <dd<dd<}d}|i d} |i d| ƒ}|i d| ƒ}y_ti|d| d|ƒ}|i|||||ƒ}|o|itd|ƒƒdSnWntij o } nX|idƒdS(só[--url] [--{dvd,vhs,video}] Returns a list of items starring the given actor. If --url is specified, a link to amazon.com's page for the match will also be returned. The search defaults to using --dvd. ssurlsdvds ProductNamestitles Manufacturers publishers MpaaRatingsmpaasMediasmedias ReleaseDatesdatesOurPricespricesURLsm%(title)s (%(media)s), rated %(mpaa)s; released %(date)s; published by %(publisher)s; price: %(price)s%(url)sisregionsbolds product_lineslocales%LNs(No items were found starring that actor.(sFalsesurlsproductsoptlistsoptions_sTruesattribssssmsgsargsschannelsselfs registryValuesregionsboldsamazons searchByActorsactorsitemss _genResultssressircsreplysformats AmazonErrorse(sselfsircsmsgsargssoptlistsactorsattribssboldsresschannelsproductsoptionses_surlsitemssregionss((s./Amazon/plugin.pysactorˆs0     E   svideocCsTt}t} x1|D])\} } | djo t}q| } qW| pd} hdd<dd<dd<d d <d d <d d<dd<}d}|i d} |id| ƒ}|id| ƒ}y_ti|d| d|ƒ}|i|||||ƒ}|o|itd|ƒƒdSnWntij o } nX|idƒdS(só[--url] [--{dvd,vhs,video}] Returns a list of items by the given director. If --url is specified, a link to amazon.com's page for the match will also be returned. The search defaults to using --dvd. surlsdvds ProductNamestitles Manufacturers publishers MpaaRatingsmpaasMediasmedias ReleaseDatesdatesOurPricespricesURLsm%(title)s (%(media)s), rated %(mpaa)s; released %(date)s; published by %(publisher)s; price: %(price)s%(url)sisregionsbolds product_lineslocales%LNs%No items were found by that director.(sFalsesurlsNonesproductsoptlistsoptions_sTruesattribssssmsgsargsschannelsselfs registryValuesregionsboldsamazonssearchByDirectorsdirectorsitemss _genResultssressircsreplysformats AmazonErrorse(sselfsircsmsgsargssoptlistsdirectorsattribssboldsresschannelsproductsoptionses_surlsitemssregionss((s./Amazon/plugin.pysdirector±s0     E   cCs0t}t} x1|D])\} } | djo t}q| } qW| pd} hdd<dd<dd<}d}|i d } |id | ƒ}|id | ƒ}y_ti|d | d |ƒ}|i|||||ƒ}|o|itd|ƒƒdSnWntij o } nX|idƒdS(s@ [--url] [--{pc-hardware,kitchen,electronics,videogames,software,photo}] Returns a list of items by the given manufacturer. If --url is specified, a link to amazon.com's page for the match will also be returned. The search defaults to using --pc-hardware. surls pc-hardwares ProductNamestitlesOurPricespricesURLs"%(title)s; price: %(price)s%(url)sisregionsbolds product_lineslocales%LNs)No items were found by that manufacturer.(sFalsesurlsNonesproductsoptlistsoptions_sTruesattribssssmsgsargsschannelsselfs registryValuesregionsboldsamazonssearchByManufacturers manufacturersitemss _genResultssressircsreplysformats AmazonErrorse(sselfsircsmsgsargssoptlists manufacturersattribssboldsresschannelsproductsoptionses_surlsitemssregionss((s./Amazon/plugin.pys manufacturerÛs2     !    s electronicsskitchens videogamesssoftwaresphotos pc-hardwarec Cso|id|idƒ odSn|idƒ}hdd<dd<d d <d d <d d<dd<dd<dd<}d}|id} |id| ƒ} |id| ƒ}y‰t i |d| ƒ}|i|||t|ƒ}|oNtd|ƒ}|iddƒ}|iddƒ}|i|dtƒdSnWnt ij o } nX|iidƒdS(s?http://www.amazon.com/exec/obidos/(?:tg/detail/-/|ASIN/)([^/]+)s linkSnarferiNis ProductNamestitles Manufacturers publishersAuthorssauthors MpaaRatingsmpaasMediasmedias ReleaseDatesdatesOurPricespricesArtistssartistsa%(title)s; %(artist)s; %(author)s; %(mpaa)s; %(media)s; %(date)s; %(publisher)s; price: %(price)ssregionsboldslocales%Ls ; unknownss; price: unknowns prefixNicks!No item was found with that ASIN.(sselfs registryValuesmsgsargssmatchsgroupsattribsssschannelsregionsboldsamazons searchByASINsitems _genResultssFalsesressformatsreplacesircsreplys AmazonErrorseslogsdebug( sselfsircsmsgsmatchsattribssboldsressitemssschannelsesregion((s./Amazon/plugin.pys amzSnarfers*N   (s__name__s __module__sTruesthreadeds callBeforesregexpss__init__s callCommands _genResultssisbnswrapsgetoptssbookssvideossasinsupcsauthorsartistsactorsdirectors manufacturers amzSnarfers urlSnarfer(((s./Amazon/plugin.pysAmazon's<    ! $ $ %6 $ $ $9 %6 &? &? $T ( samazons supybot.utilssutilsssupybot.commandsssupybot.pluginsspluginsssupybot.ircutilssircutilsssupybot.callbackss callbackss PluginRegexpsAmazonsClass(sutilssAmazons callbackssamazonspluginssClasssircutils((s./Amazon/plugin.pys?s     ÿÿ