Display headlines for syndication/affiliates

Results 1 to 3 of 3

Thread: Display headlines for syndication/affiliates

  1. #1
    Chris A. Guest

    Default Display headlines for syndication/affiliates

    How is it possible to display headlines/content in the fashion of an iSyndicate, or other syndication service, where users might sign up to display your headlines on their site using only one line of code. 4Guys does this on their ASPWire page--in the source is a simple line of Javascript:<BR><BR>&#060;script language="javascript" src="http://aspwire.com/getnews-js.asp?id=441575"&#062;&#060;/script&#062;<BR><BR>How do you output the file on the server so that it will be picked up by a line similar to this...? I&#039;m not too familiar with Javascript, but this seems like it would have lots of applications. However, I&#039;m very interested in creating a kind of affiliate/syndication thing for my sites.<BR><BR>Any thoughts on how to code it?<BR><BR>C. A.

  2. #2
    Join Date
    Dec 1969

    Default RE: Display headlines for syndication/affiliates

    I have actually written several of these types of pages. The basic idea is you use ASP to create JavaScript. Let say you want to display the Top 5 news items from your page and output it as a bulleted list. Here is what your code might look like:<BR><BR>strSQL = "SELECT Title, NewsDate FROM News ORDER BY NewsDate DESC"<BR>objRS.MaxRecords = 5<BR>objRS.Open strSQL<BR><BR>Response.Write("document.writeln(&#0 39;&#060;ul&#062;&#039;);" & vbCrLf)<BR>Do Until objRS.EOF<BR> Response.Write("document.writeln(&#039;&#060;li&#0 62;" & objRS("Title") & " (" & objRS("NewsDate") & ")&#060;/li&#062;&#039;);" & vbCrLf)<BR> objRS.MoveNext<BR>Loop<BR>Response.Write("document .writeln(&#039;&#060;/ul&#062;&#039;);" & vbCrLf)<BR><BR>Then you just supply the URL for this page in the SRC property of the Script tag. Now this is just a simple example. I&#039;ll let you have fun with figuring out how to use JavaScript escape characters to keep your write statemants from breaking. Also, look at providing other ways too. You could create JavaScript arrays for each of the fields in your recordset. Than the person using the script can display the data however they want. Or even try XML.

  3. #3
    Chris A. Guest

    Default RE: Display headlines for syndication/affiliates

    Thanks for the tip...I don&#039;t know much about Javascript so this will come in very handy. <BR><BR>C. A.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts