Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

JavaScript content sharing

Quote Reply
JavaScript content sharing
Hi,

I would like to allow other sites to include the 5 latest links on their site using a JavaScript...

Something like:
Code:
<script language="JavaScript" src="http://www.yoursite.com/cgi-bin/links/links.js"></script>

That should the produce something like:

Code:
document.write('<a href=" http://URL/To/DETAILS" target="_blank"><%Title%></a><br></font>');
...times 5

Any suggestions?

Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] JavaScript content sharing In reply to
Ok got it sorted using Pagebuilder - if anyone is interested let me know...

Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] JavaScript content sharing In reply to
"5 latest links using javascript"
Why with javascript?

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] JavaScript content sharing In reply to
To make it easy for other sites to include it... not everyone can integrate XML...

Do you have any ideas to make it easier?

Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] JavaScript content sharing In reply to
Quote:
To make it easy for other sites to include it... not everyone can integrate XML...
Ah, I see.

PageBuilder is a good solution I suppose.
Other solution would be:
1) a new plugin which is event driven, and generates regularly links.js file
2) a new script which is executed regularly by cron, and generates links.js file

No more idea at the moment.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [klauslovgreen] JavaScript content sharing In reply to
Could you post the code?
Quote Reply
Re: [Payooo] JavaScript content sharing In reply to
Hi,

I created a category page in Pagebuilder (you need the latest version of the plugin)

page name: freefeed
buildname: feed.js
MIME type: application/x-javascript
Dynamic: Yes

Template:
Code:
<%-- JAVASCRIPT FEED FOR TOP 5 LINKS --%>
<%loop links_loop%>
<%if row_num < 5%>
document.write('<a href="<%db_cgi_url%>/page.cgi?g=Detailed/<%ID%>.html&d=1" target="_blank"><%escape_js Title%></a><br>');
<%endif%>
<%endloop%>

then you can get the 5 top links from any category using:

Code:
<script language="JavaScript" src="http://yoursite/cgi-bin/links/page.cgi?page=freefeed&category=xx"></script>

where xx is the number of the category you want


Cheers
Klaus

http://www.ameinfo.com