PDA

View Full Version : Creating A Widget For Syndication


Pennimus
02-02-2007, 02:27 PM
As part of a new site I'm planning to launch I aim to create a little tool that I can syndicate to other webmasters in order to get a leg up on marketing for the site.

The site is about skateboarding and in an attempt to satiate the average skaters desire to understand what all the different skate tricks involve I want to make a tool that will basically act like a mini search engine, for skate tricks only. The aim is to allow any other webmaster to install this tool by copy/pasting a small chunk of code into their site.

However I'm not sure of the direction, coding wise, that I need to be looking.

What I know: the data is stored in an SQL database on my server; clearly the code I supply is going to need to be javascript; I typically code in PHP; it needs to be secure as hell so my data can't be tampered with.

What I have no idea about: how you string together a javascript on a 3rd party site with a database query at my end, and then send the information back to the 3rd party site and display it.

Can anyone recommend some resources on doing this type of thing, or any ideas? I'm basically at the stage where I don't even know what I should be typing in to Google :)

EDIT: Note, I'd rather not use an iFrame solution for this if at all possible.

Arragon
02-02-2007, 10:05 PM
First thought: Redirect the user to your server. All that need to be hosted on your affiliates website is really just a search form. Have the action of that form point to a page/script/cgi/whatever on your server to display the results. This is the best way to do this if you are providing a free service. This is not so useful if the result needs to display on the affiliates page for some reason.

Second thought: Popup window. Serve a popup from your server and you can generate search results without the user leaving the affiliate website. Danger: popups are easy to abuse, block, and annoy.

I have worked with various professional websites providing content to affiliates and the most robust of these include account management and templating features for serving the content. Basically the affiliate signs up with you, provides you a style sheet or html template of some kind and then you serve your content in their wrapper keyed to the unique ID in the code you provide them. If maintaining the affiliates look and feel is important, you can try following this route and it will work with both of the above techniques. The downside is that the user ends up at your server even though the look and feel of the affiliate is maintained. Oh and the administration can be a PITA, so don't bother with this unless you are being paid well for your content.

Third thought: Frames. This is a sucky idea. Unless you are a whiz at styling I-frames, forget I mentioned it.

Final thought: If it is absolutely critical that the user never gets re-directed off the affiliate server and that your content matches the affiliate sites look and feel, the only way to go is with AJAX. You will have to create a javascript widget that polls your server for query results and then inserts those results into the DOM on the affiliate page. Cool factor high. Affiliate happiness high, user never leaves their pages or advertising (you better get paid well for providing this). The hassle factor could be high depending on your experience with AJAX. And the security will also depend on your experience with AJAX.

Good luck

Pennimus
02-05-2007, 10:24 AM
Hey man, thanks for the comprehensive reply.

As you more or less correctly guessed, the first three thoughts aren't really an option for me. I'd basically already figured out that it would need to be a javascript based solution, but I have no coding experience outside of PHP, hence not knowing what to start searching Google for.

In the event, I think I'm going to outsource this as I don't really have the time to learn AJAX and be able to guarantee that whatever I produce is secure.

Affiliate happiness high, user never leaves their pages or advertising (you better get paid well for providing this)

Oh, I will... :D

FJbrian
02-08-2007, 06:18 PM
yahoo has a widget development program I think it's at developer.yahoo.com

I played around with it quickly and it looked like they spelled things out well and made it easy to do. I didn't actually try to create something so I don't really know but.....might be worth a look