Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Live "Feeds" on my Site

Posted on 2013-12-31
8
Medium Priority
?
388 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
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).

688 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