Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #1 (permalink)  
Old 07-13-2012, 03:46 AM
PandoraH's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 02-07-11
Location: New England
Posts: 64
iTrader: 0 / 0%
ARG! Embeding RSS feeds into .html page with Javascript

Greetings all...been a away while, but now am back

This is more of a solution request, then a request for specific help...

Summary: Looking for a solution that will allow me to embed a RSS feed into a static .html page Start Page

Details

I am in the process of building a series of .html pages that will reside on my machine and act as my Browser Start Page (FF and Chrome).

One of the things I need to create is a set of scripts and code that will allow me to insert RSS from various sources online, and then be able to customize the look and layout of said feed. And eventually, these pages will be made public, so updating the RSS feed URLS must be simple (no more complicated then opening the .html files in notepad or dreamweaver and editing a few lines of code).

To that end, I am looking for a javascript solution that will allow customization through CSS4 and HTML4/5. If there is a non-flash/php solution that I have overlooked, I'd also consider that.


My Concerns

Based on what I have read, I'll need access to one or more API's. I do not want to use a 3rd party solution, and intend to create the Javascripts myself. The issue here is that I am not quite sure how to proceed. A lot of the data I've found via Google search is old. Some of the API's mentioned are no longer available. I've found some resources that discuss creating scripts, but they are also a bit on the old side.

I'm hoping to get some advice on where to head online to get up to date information. Or, to correspond with someone who has been doing this sort of coding recently. I am not looking to be hand held, but a push in the right direction would be much appreciated, as I am very new to this sort of thing.

Thanks!
 
Reply With Quote
  #2 (permalink)  
Old 07-13-2012, 03:59 PM
Super Moderator
Latest Blog:
None

 
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 1,730
iTrader: 0 / 0%
With the restrictions you set, i don't think your problem can be solved. If you want to read news feed with javascript, you will need to use the XMLHttpRequest object to read the news feed, but because of security, you can't use XMLHttpRequest to read the news feed from a 3rd part website. So you will need to use something in between there can read the news feed data and return it to the javascript, you will need something like php for that, or a 3rd part api.
__________________
Need a break? EnterCave more than 40000 online games in 15 categories.
Search or browse through EnterCave Online Games Directory
 
Reply With Quote
  #3 (permalink)  
Old 07-14-2012, 01:14 AM
PandoraH's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 02-07-11
Location: New England
Posts: 64
iTrader: 0 / 0%
Actually, I did mention API’s in my original post, as I think I will need to use them. I did not say I would not use API’s, but I did say I didn’t want to use 3rd party solutions.


What I meant by 3rd party solutions is the service a lot of websites offer, where you input the RSS feed URL into a form field, and the form spits out code (<script> code, specifically) that can be inserted into an html page.)

Also, please note that I did state that I may have overlooked another solution and that I would be glad to hear it. Thank you for your reply, btw.
 
Reply With Quote
  #4 (permalink)  
Old 07-14-2012, 12:49 PM
Super Moderator
Latest Blog:
None

 
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 1,730
iTrader: 0 / 0%
3rd part api / 3rd part solution, in this context it sound like the same to me, but English is not my first language, so that might be the problem.

Anyway, not really knowing if you want to use a 3rd part api or not, and 3rd part api is probably the only way to solve this problem, i will take a chance and post a link to at Google api and hope it's helpful.

Google Feed API:
Quote:
With the Feed API, you can download any public Atom, RSS, or Media RSS feed using only JavaScript, so you can easily mash up feeds with your content and other APIs like the Google Maps API.

The Google Feed API takes the pain out of developing mashups in JavaScript because you can now mash up feeds using only a few lines of JavaScript, rather than dealing with complex server-side proxies. This makes it easy to quickly integrate feeds on your website.
Source: https://developers.google.com/feed/v1/
__________________
Need a break? EnterCave more than 40000 online games in 15 categories.
Search or browse through EnterCave Online Games Directory
 
Reply With Quote
  #5 (permalink)  
Old 07-25-2012, 01:27 PM
PandoraH's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 02-07-11
Location: New England
Posts: 64
iTrader: 0 / 0%
Updated - Specfics

Sheesh, I have been trying to get help on this for over a week now, and it seems very few people either have the knowledge, or want to discuss it.

Here is what I posted in the Google API group, which after 5 days has still not appeared:

GAH! Help Needed: Feed API, JSON Parameters

I'm very new to this sort of programming, and am at my wits end trying to figure this out. The main problem is that I am so very new, I do not understand HOW to build this, even after doing some reading and testing. Here is what I am trying to do:

Summary:
Multiple RSS Feed deployment on a series of client side .html pages. These pages will be heavily themed using images and CSS, and the feeds will need to blend in. These .html pages will be used as my Start Page,stored on my PC, and launched by my default and alt Browsers (FF and Chrome).

Script Details

API: Google Feed API
Format: JSON


Current Difficulty

I have repeatedly read, and tried all sorts of things based on this page:
https://developers.google.com/feed/v...ide#resultJson

My current issue is that I do not where to insert, and how write the proper code to incorporate the proper JSON code to display:

Post Title with (Clickable URL)

Post Description (with code to adjust number of charecters displayed)

And also, the best way to display 3 feeds on a single page - Eventually they will be displayed in 3 column display.


This page shows my current progreess (1 Feed, no JSON paramters)

Page URL
http://www.pharper2012.byethost8.com...eed-plain.html

Thanks in advance to anyone who can help me get past this hurdle! I am SOOO frustrated!
 
Reply With Quote
  #6 (permalink)  
Old 07-25-2012, 08:33 PM
Super Moderator
Latest Blog:
None

 
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 1,730
iTrader: 0 / 0%
I made an example with 3 feeds you might want to play with:
Code:
<html> <head> <style type="text/css"> .feedItemsContainer { background-color: white; border: 2px solid black; width: 400px; margin-bottom: 10px; } .feedItemClass { background-color: lightblue; border: 1px solid white; border-top: 0px; } .feedItemTitleClass,.feedItemDescriptionClass { padding: 2px; } .feedTitleClass { padding: 4px; text-align: center; font-weight: bold; } </style> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> <!-- //These variables can be changed to fit your needs var maxFeedItems = 10; //the feeds - first the feeds urls, second the IDs of the containers where the feed data should be added to var feeds = [ ["http://www.v7n.com/forums/external.php?type=RSS2&forumids=16","Feed01"], ["http://www.v7n.com/forums/external.php?type=RSS2&forumids=45","Feed02"], ["http://www.v7n.com/forums/external.php?type=RSS2&forumids=22","Feed03"] ]; // this variable should not be changed var curFeedIndex = 0; function initialize() { var feedItem = ""; var feed = new google.feeds.Feed(feeds[curFeedIndex][0]); feed.setNumEntries(maxFeedItems); feed.load(function(result) { if (!result.error) { feedItem = "<div class=\"feedTitleClass\">" + result.feed.title + "</div>"; for (var i = 0; i < result.feed.entries.length; i++) { var entry = result.feed.entries[i]; feedItem += "<div class=\"feedItemClass\">"; feedItem += "<div class=\"feedItemTitleClass\"><a href=\"" + entry.link + "\">" + entry.title + "</a></div>"; feedItem += "<div class=\"feedItemDescriptionClass\">" + entry.contentSnippet + "</div>"; feedItem += "</div>"; } document.getElementById(feeds[curFeedIndex][1]).innerHTML = feedItem; if(curFeedIndex < feeds.length) { curFeedIndex++; initialize(); } } }); } google.load("feeds", "1"); google.setOnLoadCallback(initialize); --> </script> </head> <body> <div id="Feed01" class="feedItemsContainer"></div> <div id="Feed02" class="feedItemsContainer"></div> <div id="Feed03" class="feedItemsContainer"></div> </body> </html>
__________________
Need a break? EnterCave more than 40000 online games in 15 categories.
Search or browse through EnterCave Online Games Directory
 
Reply With Quote
  #7 (permalink)  
Old 07-26-2012, 01:46 PM
PandoraH's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 02-07-11
Location: New England
Posts: 64
iTrader: 0 / 0%
Gosh thanks! This is a great example. I was pretty close with some of the code for the title and description, but way off on other stuff. Again, many thanks
 
Reply With Quote
  #8 (permalink)  
Old 08-08-2012, 10:33 PM
Junior Member
 
Join Date: 09-15-11
Posts: 6
iTrader: 0 / 0%
I am looking for something similar. I need one that will display the latest url from a feed. I have figured out how to display the latest post with a link to it but I do not want the post title in the display.
 
Reply With Quote
  #9 (permalink)  
Old 08-10-2012, 06:08 AM
Super Moderator
Latest Blog:
None

 
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 1,730
iTrader: 0 / 0%
Quote:
Originally Posted by Emmett View Post
I am looking for something similar. I need one that will display the latest url from a feed. I have figured out how to display the latest post with a link to it but I do not want the post title in the display.
Could you give me an example of how you want the feed item to be shown or give a little bit more details about how the feed item should be shown?
__________________
Need a break? EnterCave more than 40000 online games in 15 categories.
Search or browse through EnterCave Online Games Directory
 
Reply With Quote
  #10 (permalink)  
Old 08-10-2012, 08:18 AM
Junior Member
 
Join Date: 09-15-11
Posts: 6
iTrader: 0 / 0%
I do not want the post title to show. I want the url or the site title to be displayed with a short description of the post.
 
Reply With Quote
  #11 (permalink)  
Old 08-10-2012, 09:27 AM
Super Moderator
Latest Blog:
None

 
Join Date: 11-11-11
Location: Copenhagen, Denmark
Posts: 1,730
iTrader: 0 / 0%
Quote:
Originally Posted by Emmett View Post
I do not want the post title to show. I want the url or the site title to be displayed with a short description of the post.
Something like this:
Code:
<html> <head> <style type="text/css"> .feedItemContainer { background-color: white; border: 2px solid black; width: 400px; margin-bottom: 10px; } .feedItemClass { background-color: lightblue; border: 1px solid white; border-top: 0px; } .feedItemURLClass,.feedItemDescriptionClass { padding: 2px; } .feedTitleClass { padding: 4px; text-align: center; font-weight: bold; } </style> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> <!-- function initialize() { var feed = new google.feeds.Feed("http://www.v7n.com/forums/external.php?type=RSS2&forumids=16"); feed.setNumEntries(1); feed.load(function(result) { if (!result.error) { var entry = result.feed.entries[0]; var shownURL = entry.link; if(shownURL.length > 40) { shownURL = shownURL.substring(0, 40) + "..."; } var feedItem = "<div class=\"feedItemClass\">"; feedItem += "<div class=\"feedItemDescriptionClass\">" + entry.contentSnippet + "</div>"; feedItem += "<div class=\"feedItemURLClass\"><a href=\"" + entry.link + "\">" + shownURL + "</a></div>"; feedItem += "</div>"; document.getElementById("Feed").innerHTML = feedItem; } }); } google.load("feeds", "1"); google.setOnLoadCallback(initialize); --> </script> </head> <body> <div id="Feed" class="feedItemContainer"></div> </body> </html>
__________________
Need a break? EnterCave more than 40000 online games in 15 categories.
Search or browse through EnterCave Online Games Directory
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
html/javascript GiffHost Coding Forum 5 02-14-2012 09:39 AM
Inserting html page in other html page & shared border problem globalcashsite Web Design Lobby 5 07-16-2009 08:53 AM
HTML: What if html tidy messes with the page layout ? Linda in NY Coding Forum 63 04-18-2007 08:54 AM
Need some suggestion for html and javascript ston Web Design Lobby 2 10-04-2006 09:24 PM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 06:10 PM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.