Gossamer Forum
Home : Products : Links 2.0 : Customization :

Adding Amazon code to search results

Quote Reply
Adding Amazon code to search results
I was wondering if there was a way to add a way when someone searches they can click on a section on the topic to search on Amazon.com with an affiliate code present in the code.

Thanks,
LPLuby
Quote Reply
Re: Adding Amazon code to search results In reply to
You can do the following:

Open site_html.pl . Under global definitions put this line:

$search_keywords= @search_terms;

Then wherever you prefer in the sub site_html_search_results you can put the search code for amazon.com like this:

http://www.amazon.com/exec/obidos/external-search?mode=books&keyword=@search_terms&tag=YourAfiliateCodeHere

It works fine for me. Click the link below and see the results.

http://martial-arts.hypermart.net/...rch.cgi?query=Karate


Hope that helps


Eduardo



Quote Reply
Re: Adding Amazon code to search results In reply to
Is your editor's pick page built on the fly also?

bye for now
Quote Reply
Re: Adding Amazon code to search results In reply to
Thanks,
I got it to work. Smilehehe
Quote Reply
Re: Adding Amazon code to search results In reply to
Yes, pick pages are build on the fly just like search results, etc...


Eduardo
Quote Reply
Re: Adding Amazon code to search results In reply to
Ooops! i've made mistake

Rewiew pages are built on the fly. Editor's pick pages are static.

Eduardo
Quote Reply
Re: Adding Amazon code to search results In reply to
Hi,

How would I get this to work for templates in v2b5? How are results displayed on links as opposed to the queried sited? I would love to get this to work...

Thanks in advance,
elms
Quote Reply
Re: Adding Amazon code to search results In reply to
To add amazon search results, add the following code to the search_results.html template where you would like it to be displayed.

<A href="http://www.amazon.com/exec/obidos/external-search?mode=books&keyword=<%term%>&tag=AFFILIATE ID" target="_blank"><%term%><FONT size="2" face="Verdana">
</FONT></A>

To see a working example, go to:
<A HREF="http://www.web-source.net/cgi-bin/links/search.cgi?query=autoresponders">http://www.web-source.net/cgi-bin/links/search.cgi?query=a utoresponders</A>

It isn't completely set up yet but you'll get an idea of what it will look like.
Quote Reply
Re: Adding Amazon code to search results In reply to
Thanks Hope,

I actually have it working that way. The question I have was instead of having the results showing on amazon.com's site is there a way to show it on links v2b5. I do not think that there is a mod for amazon.com as there is on altavista.

Thanks again,
elms
Quote Reply
Re: Adding Amazon code to search results In reply to
Sorry, I can't help you with that, but I would also be interested in setting up the Amazon's search results in this way. Good Luck to you.

Thanks
Quote Reply
Re: Adding Amazon code to search results In reply to
The way you guys explained it didn't work for me (maybe because I'm using Links2.0b5). But anyways, I use the site_html.pl to edit my stuff, and the code I use is as follows:
Code:
<a target="_blank" href="http://www.amazon.com/exec/obidos/external-search?mode=books&keyword=$term&tag=YOUR_ASSOCIATES_ID">Search amazon.com for Books on $term</a>

For CD's or videos all you have to do is chancge the "mode" to "music" (for cd's, no quotes) and to "video" (for videos, no quotes).

Regards,
Brian

[This message has been edited by mjordn12 (edited February 19, 1999).]
Quote Reply
Re: Adding Amazon code to search results In reply to
I am not sure if that is already what you guys are trying to achieve but I thought I should mention:

If a surfers arrives at Amazon's site through a url that directly points to a particular book then you will earn 15% commission but if you site links to a general sort of area then you only get 5%. Is there a MOD for Links 2 to do this?
Quote Reply
Re: Adding Amazon code to search results In reply to
Hey everybody take a look at this!

http://www.anaconda.net/index.shtml

I think you'll like it alot!

Thanks

Philip
Quote Reply
Re: Adding Amazon code to search results In reply to
It doesn't work for me. It always comes up with a blank search. The @search_terms doesn't work. Please help.
Quote Reply
Re: Adding Amazon code to search results In reply to
THIS IS HOW I EDITED!...

WHERE DO YOU PLACE THIS LINKE?

http://www.amazon.com/exec/obidos/external-search?mode=books&keyword=@search_terms&tag=YourAfiliateCodeHere



ANYWHERE? PLEASE BE SPECIFIC...

NO QUOTE? NO "<" OR ">" NO "%"? AND NO "%" ?

THIS IS MY CODES: I WOULD LIKE TO KNOW WHERE TO PLACE THAT LINE IN:

=================================
LINKS V2.0

##########################################################
## Search Results ##
##########################################################

sub site_html_search_results {
# --------------------------------------------------------
# This routine displays the search results.
#

my (@hits) = @_;
my $term = &urlencode ($in{'query'});

&html_print_headers;
print qq~

<html>

<head>
<title>$site_title: Search Results</title>

</head>

<$site_body>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle" width="1%"><a href="http://www.delt.net"><img
src="http://www.trisoft.net/images/logo.gif" alt="Delt.NET" border="0"></a> </td>
<td valign="middle"><table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="left" valign="bottom"><p align="right"><font face="arial" size="-1"><right" valign="bottom"><a
class="menulink" href="$build_add_url">Add Site</a> - <a
href="$build_modify_url">Modify Site</a><font face="arial" size="-1"> - <a
href="http://www.trisoft.net/maillogin/">Check E-mail</a></font> </font></td>
</tr>
</table>
<hr size="1" noshade>
</td>
</tr>
</table>


<div align="center"><center>

<table border="0" cellpadding="5" cellspacing="0" width="100%" bgcolor="#FE701B">
<tr>
<td width="100%" bgcolor="#A0B8C8"><p align="left"><strong>$site_title: Search Results</strong></td>
</tr>
</table>
</center></div>

<p><!------------- AD BANNER HERE ----------></p>

$site_menu

<p>Your search returned <strong>$cat_hits</strong> categories and <strong>$link_hits</strong> Links.</p>

~;
if ($next) {
print qq~<p>Pages: $next</p>
~;
}
if ($category_results) {
print qq~
<h2>Categories:</h2>
<ul>$category_results</ul>
~;
}
if ($link_results) {
print qq~
<h2>Links</h2>

$link_results
=====================================
I INSERT IT HERE! BELOW THIS $LINK_RESULTS W/ NOTHING ELSE BUT THE HTTP: YOU GAVE US... WHAT ELSE?
=====================================

http://www.amazon.com/exec/obidos/external-search?mode=books&keyword=@search_terms&tag=YourAfiliateCodeHere
=====================================

~;
}
if ($next) {
print qq~
<p>Pages: $next</p>
~;
}
print qq~

<p><small>
<b>Try your search on other Search Engines</b><br>
<a target="_blank" href="http://www.altavista.digital.com/cgi-bin/query?pg=q&what=web&q=$term">Alta Vista</a> -
<a target="_blank" href="http://www.hotbot.com/?MT=$term&DU=days&SW=web">HotBot</a> -
<a target="_blank" href="http://www.infoseek.com/Titles?qt=$term">Infoseek</a> -
<a target="_blank" href="http://www.dejanews.com/dnquery.xp?QRY=$term">Deja News</a> -
<a target="_blank" href="http://www.lycos.com/cgi-bin/pursuit?query=$term&maxhits=20">Lycos</a> -
<a target="_blank" href="http://search.yahoo.com/bin/search?p=$term">Yahoo</a>
</small></p>

$site_footer

</body>
</html>
~;
}

------------------
WebKing
WebKing@trisoft.net
http://www.trisoft.net
My ICQ # 25356171
Quote Reply
Re: Adding Amazon code to search results In reply to
Webking,

Insert it in this section and follow the format:

Code:
<p><small>
<b>Try your search on other Search Engines</b><br>
<a target="_blank" href="http://www.altavista.digital.com/cgi-bin/query?pg=q&what=web&q=$term">Alta Vista</a> -
<a target="_blank" href="http://www.hotbot.com/?MT=$term&DU=days&SW=web">HotBot</a> -
<a target="_blank" href="http://www.infoseek.com/Titles?qt=$term">Infoseek</a> -
<a target="_blank" href="http://www.dejanews.com/dnquery.xp?QRY=$term">Deja News</a> -
<a target="_blank" href="http://www.lycos.com/cgi-bin/pursuit?query=$term&maxhits=20">Lycos</a> -
<a target="_blank" href="http://search.yahoo.com/bin/search?p=$term">Yahoo</a>
</small></p>

Are you going to use templates or site_html.pl?

If you keep on switching between the two you are going to get confused with everyone helping you in different methods of setting up links. It is best to decide and stick with just one.

Just an advice,
elms


------------------
www.webmerch.com
links@webmerch.com







[This message has been edited by elms (edited March 14, 1999).]