Solved

Live "Feeds" on my Site

Posted on 2013-12-31
8
369 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 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
 

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to show span when clicked on? 10 32
DataTables + iCheck + pagination Issue 2 47
How to resize a div in html 3 39
ASP exit 10 20
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... …
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 tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…

820 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