Solved

Live "Feeds" on my Site

Posted on 2013-12-31
8
366 Views
Last Modified: 2014-01-01
I have a site that provides results for running events, nordic ski events, cross-country running, etc.  I would like to re-design our home page to provide continuous feeds (via something like an iframe or a plugin so that when folks come to the site for results they can get some news as well.

Thanks~
0
Comment
Question by:Bob Schneider
8 Comments
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39749545
Sounds great. Do you have any issues with the site or looking for someone to do it for you?
0
 
LVL 16

Expert Comment

by:Imran Javed Zia
ID: 39749741
Hi,

For this you can use RSS.
You may just implement a RSS client for your home site. and may need to implement or consume RSS services from other data providers.

Thanks and Regards
0
 

Author Comment

by:Bob Schneider
ID: 39749848
Do you know of any resources for implementing this process?  Is it difficult to do for a hack programmer like myself?
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39749901
BobbaBuoy, This can be very easy.  

1) Create an ASP page as you already know how.
The page may simple contain a list of results from your db.  The page should not have anything else.  Just your list which could be a table or div's

Road Runner   14:58:12
Mr Magoo       15:24:32
Bugs Bunney   15:25:47
W. Coyote        15:38:25

or
Road Runner - 14:58:12  Mr Magoo - 15:24:3    Bugs Bunney -v15:25:47    W. Coyotev-v15:38:25
2) On the the home page, create an ajax post that brings in that page.
$.ajax({
  type: "POST",
  url: "results.asp"
})
  .done(function( data ) {
    $('div#ticker').html(data);
  });

Open in new window

The code above will place the data from results.asp to a div with the ID "ticker" on your home page.

You can wrap that in some type of timer that refreshes every x seconds.  

There are also ticker plug ins for jquery like http://jonmifsud.com/open-source/jquery/jquery-webticker/
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Bob Schneider
ID: 39749920
Thanks but what I am looking for is feeds from things like Track & Field News, Runners World, NCAA Cross-Country, etc.  I woud like a set of "feeds" that have links that are posted by the host site that my users can simply click on if an article piques their interest.

I don't really want to go the i-frame route...I assume there is better technology for this out there, no?

Sorry if i have not made this clear.
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39749943
You can still use this method.

$.ajax({
  type: "POST",
  url: "http://someothersite.com"
})
  .done(function( data ) {
    $('div#ticker').html(data);
  });

Open in new window

Except you would need to edit this portion " $('div#ticker').html(data);" for the data anyway where you only pull in what you want. This is not a frame it is actually placing the content on your page after it loads.   However, some of these sites already have feeds and it is best to use them.  Watch that the method I describe does not violate and TOS.  This is called screen scraping.  You would need to design the method specifically for each bit of content.

You can also do this server side with your vb script.  Below I have done virtually the same thing I describe above but using xmlhttp post.  Below is real coding I use to do the very same thing you are describing.

The xmlhttp post sends a get to somesite.com/somepage.aspx and it returns all the html.

I only am interested in the portion of code that is inside a <form></form> tag.  YOu will see I use the mid function to look through theHTML and just return starting at <form> and ending in </form>.

You will see some replace functions where I am eliminating or changing some of the html.  

Then finally response.write theHTML to my page.  I do have permission to do this.  Just make sure you avoid any copyright mess.
<%
    
	url = "http://somesite.com/somepage.aspx" 
    set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") 

  
    xmlhttp.open "GET", url, false 
	xmlhttp.setRequestHeader "User-Agent","BobbaBuoy"
    xmlhttp.send "" 
	txtstart= instr(1,xmlhttp.responseText, "<form>",1) 
    txtend= instr(1,xmlhttp.responseText, "</form>",1)
	response.write("<div id=""xyzabc"">")
	theHtml= mid(xmlhttp.responseText, txtstart, txtend-txtstart)
    theHtml=replace(theHtml,"<form>","")
	theHtml=replace(theHtml," <div class=""content"">","")
	theHtml=replace(theHtml,"bgcolor=""#0B294D""","bgcolor=""#990000""")
	theHtml=replace(theHtml,"<a href=""somepage.aspx","<a target=""_blank"" href=""http://www.somesite.com/landingpage.aspx")
	
	
	theHtml=replace(theHtml,"src=""Images","src=""http://www.somesite.org/Images")
	response.write theHtml
	response.write("</div><!-- end -->")
    set xmlhttp = nothing 

%>

Open in new window

0
 

Author Closing Comment

by:Bob Schneider
ID: 39749964
Thank you so much!
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39749968
Thanks!  By the way, the jquery method I posted in the last post is not correct or that simple because it is cross domain.  Use the serverside xmlhttp post method.

Thanks! Happy New Year!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
spacing 5 54
iOS 10 iPad Zoom and acroll 4 49
How to create a 3-column full-width flex button layout 1 23
CSS change width browser switches to mobile view 2 44
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now