Solved

Live "Feeds" on my Site

Posted on 2013-12-31
8
372 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 43

Expert Comment

by:Rob
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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 53

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
 

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 53

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 53

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

752 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