JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 1st, 2012, 04:58 AM
XzK XzK is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 2 XzK User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 56 sec
Reputation Power: 0
Browse News Widget

Hello everyone!

I need a help for a widget like flashreseller.com/files/xml-browse-news-widget/1

The problem is this one is designed using Flash, but I don't want it, I want to do this in JavaScript. In my case, the script should get the news from WordPress-based website. I don't know how to proceed in this case. Any help would be greatly appreciated.

Thanks in advance!

Reply With Quote
  #2  
Old December 1st, 2012, 11:14 PM
web_loone08's Avatar
web_loone08 web_loone08 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2008
Posts: 599 web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 12 h 40 m
Reputation Power: 69
I created a widget based on this same idea; not to long ago. Though..., I didn't have the scroll up and down feature, but I did get the content from another site's XML feed and created my own JsPhp Widget. So... that's what I suggest for you too.

My JsPhp Widget Example

PHP Code:
scrapperJS.php
<?php
header
("Content-type:text/javascript");

// Define PHP Variables

$widget_text file_get_contents("https://cio.gov/category/blogs/feed/"); // Example of Word Press Blog XML Feed

$widget_text addslashes($widget_text);

$widgeTextFormat preg_replace("/\n/","",$widget_text);

// Define External JavaScript File

echo "var widgeText = \"$widgeTextFormat\";

var amount_of_listings = 10; // Define Amount of Blog Post To Display

function getWP()
{
amount_of_listings = amount_of_listings + 1;
document.getElementById(\"myWidget\").innerHTML=\"<hr/>\";
 for (i=2;i<=amount_of_listings;i++) {
  document.getElementById(\"myWidget\").innerHTML += \"<a href='\" + widgeText.split(\"<link>\")[i].split(\"</link>\")[0] + \"'>\" + widgeText.split(\"<title>\")[i].split(\"</title>\")[0] + \"</a><hr/>\";
 }
}

document.onreadystatechange = function() {
 if (document.readyState==\"complete\") {
  new getWP();
 }
}"
;

?>


Code:
HTML
<script type="text/javascript" src="scrapperJS.php"></script>

<span id="myWidget"></span>

Reply With Quote
  #3  
Old December 2nd, 2012, 03:54 AM
XzK XzK is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 2 XzK User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 56 sec
Reputation Power: 0
Thumbs up

Thank you so much!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Browse News Widget

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap