Announcements News Feed or RSS

Announcements News Feed or RSS

by Michelle Feldman -
Number of replies: 20
Is there any way to create a feed so that one can display news & announcements from Moodle on a page outside the Moodle application?  Normally, I would just create a weblog for my client but in this case the client wants to use Moodle as the method for school announcements and news and I don't want the organization to have to write up news in 2 places.
Average of ratings: -
In reply to Michelle Feldman

Re: Announcements News Feed or RSS

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Michelle,

I had some old RSS java code. I've translated it and it seems to work.

Instructions:

- gunzip and untar this post's attachment.
- copy the news dir under your moodle home.
- make the dir and the news.xml file inside writable for all.
- login into your moodle server as admin.
- invoke manually http://your_server/moodle/news/news.php
- open your RSS client.
- subscribe to http://your_server/moodle/news/news.xml
- enjoy!!

Hope it helps,ciao smile

PS: You can personalize the RSS image (changing news.gif), the number of news to publish (editing news.php->$max_num_articles) and the destination file to save the rss (editing news.php->$destination_file).
Average of ratings: Useful (1)
In reply to Eloy Lafuente (stronk7)

Re: Announcements News Feed or RSS

by Michelle Feldman -
Eloy -

Thanks for your module - I have got it up and running and am translating it using an rss parser for the home page of the site.  Couple of questions:
1.  How do you get rid of the image altogether?  I do not have much room for the display of my feed so I need to remove all ancillary parts.
2.  Do I need to set up a chron job to get the php to automatically update the xml page?

Thanks!

Michelle
In reply to Eloy Lafuente (stronk7)

Re: Announcements News Feed or RSS

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Cool, Eloy!

I'd like to integrate this properly eventually but for now I've made a feed for moodle.org:

http://moodle.org/news/news.xml

Michelle, you can make a cron job the same way you made one for Moodle cron.php (you will just have to make sure to remove the line at the top that requires the admin and find another way to protect it), or just run Eloy's script manually whenever you change the site news.
In reply to Martin Dougiamas

Re: Announcements News Feed or RSS

by Loren Winfrey -
Ok this looks cool, a question, is it possible to pump out into a format that can be imported into palm application (thinking of avantgo)? About two thirds of my students use them and this would be nice if it can add thier course calendar info as well.

Just thinking ahead...[grin]

Loren
In reply to Martin Dougiamas

Re: Announcements News Feed or RSS

by Tony Hursh -

This is great. Thanks for implementing it, and thanks to Eloy for providing the script. RSS is a subject near and dear to my heart, since one of my side projects, HyperDig, is a web-based RSS aggregator.  I'm looking forward to this getting integrated into the code base.

From a mangerial standpoint, it might be useful to have RSS feeds for the "Latest news" and "Recent activity" boxes, too. It'd be great to be able to monitor what was going on in multiple courses without having to switch into each course.

In reply to Tony Hursh

Re: Announcements News Feed or RSS

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Tony,

changing slightly the news.php file you can execute the script for each course in your server:

- Copy your news.php to news_per_course.php

- Edit news_per_course.php

- Change line 10 from:
$destination_file = $CFG->dirroot."/news/news.xml";
to
$destination_file = $CFG->dirroot."/news/news".$id.".xml";

- Change line 56 from:
$newsforum = forum_get_course_forum($site->id, "news");
to
$newsforum = forum_get_course_forum($id, "news");

- Invoke news/news_per_course.php?id=ZZ (where ZZ is the id of your desired course)

- This will generate a newsZZ.xml file with the news from your course.

It'll need some refinements but I think It'll work!

Hope it helps....

Ciao smile
In reply to Eloy Lafuente (stronk7)

Re: Announcements News Feed or RSS

by W Page -
Elroy,

I ask humbly, please do a step by step "HowTo" for RSS feeds for
  • Moodle news
  • Moodle Categories
  • Moddle Course (Posting of new Activies / Resources / etc...
  • Moodle Events
and place in into the
"New HowTos" forum located at,
http://moodle.org/mod/forum/view.php?id=1428

Also a doc which might be helpful,
Final HowTo Format
http://moodle.org/mod/resource/view.php?id=1431

As Loren indicated above it would be nice to be able to download Moodle news into a "HandHeld". This has been discussed on some other threads,
New Module: Shelf
http://moodle.org/mod/forum/discuss.php?d=4734
Pocket PC "Handhelds/Palm OS" Themes
http://moodle.org/mod/forum/discuss.php?d=2780

There appears to be two main HandHeld programs,
Avantgo - which I think is now pay for those who want to post links to their sites
Plucker - which is open source.

Some sites provide direct links to Avantgo and Plucker. A coder did this for phpNuke sites.

I am not a programmer (yet smile big grin) but I am putting the information out there in the hopes that one of the programmers will take this task on. I also think it will be a great promotion feature for Moodle and Moodle based sites.

Thanks for all your work.

WP1
In reply to Eloy Lafuente (stronk7)

Re: Announcements News Feed or RSS

by Tony Hursh -

Thanks! I'm wary of doing any code changes right now, 'cause we're in the middle of a semester. I'm going to upgrade our site to 1.2.1 after the session ends in May.  I'll give your XML stuff a try then.

This is really appreciated!

In reply to Eloy Lafuente (stronk7)

Re: Announcements News Feed or RSS

by Ger Tielemans -

Ok, after reading Martin's RSS reference, I see the educational value...

phough..I have now my local /news/news.xml in place

If I now want a rss-box on my frontpage, what should I type in this box:

 print_side_block_start( "<center><b>Moodle<sup>RSS</b></sup></center>", 210,"");

...

 print_side_block_end();
 print_spacer(10,$side);


I was wondering if this could help: http://www.phpclasses.org/browse/package/80.html

In reply to Ger Tielemans

Re: Announcements News Feed or RSS

by Crafton Williams -
Can anyone tell me, for example the RSS for moodle by Eloy, how does the xml page that contains the feed update every time there is a new feed. I don't see anywhere that calls the news.php function to rewrite the page.

thanks in advance.

Crafton,
newbie 
In reply to Crafton Williams

Re: Announcements News Feed or RSS

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Crafton,

as RSS feeds aren't part of Moodle's official release, there isn't any frontend to configure or execute it (manually or automatically).

The easiest proc. to do this is:

Invoke http://yourserver/yourmoodle/news/news.php manually from the browser to update your news. You must be logged as admin before!

Too, you can use some type of cron system, but it involves modifying news.php and it's more complicated!

Ciao smile
In reply to Eloy Lafuente (stronk7)

Re: Announcements News Feed or RSS

by Crafton Williams -
Thanks for your quick response Eloy, i understand  now.

Crafton
In reply to Michelle Feldman

Re: Announcements News Feed or RSS

by Marc Dastous -

I see that RSS has made it into a recent nightly version of 1.3dev.  Is there any documentation produced that would help me test this feature?  I am curious how it functions.

Marc

In reply to Marc Dastous

Re: Announcements News Feed or RSS

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Marc,

you can find some info about RSS feeds here.

Closing this discussion just now, ciao smile
In reply to Eloy Lafuente (stronk7)

Re: Announcements News Feed or RSS

by Ger Tielemans -
Do I always need a RSS application to read the news, or is it possible to make (scrolling?) rss news window on the frontpage?
In reply to Ger Tielemans

Re: Announcements News Feed or RSS

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Ger,

you always need a RSS client to read the news. It's how RSS feeds work...

Other different thing is that, under Moodle, it's possible to build an RSS client (using the Blocks System, perhaps) to display such info, and potentially, any RSS feed in the world... cool

Some days ago, Jordi Adella submitted a new bug about this.

Ciao smile

Average of ratings: Useful (1)
In reply to Eloy Lafuente (stronk7)

Re: Announcements News Feed or RSS

by Daryl Hawes -
Eloy,
The simplog module that I am working on currently handles rss subscriptions which it displays in its own side blocks. I hope to have it in contrib soon so that we can work on further integrating it.
Daryl
In reply to Michelle Feldman

Re: Announcements News Feed or RSS

by Roland Becker -

Hi

actually this is what I want to do with some of the Moodle contents from one site http://club.centroamerica.tv/ at another central news site: http://news.centroamerica.tv/ as well as on others.

The tool I use for that is pretty cool and complete, regarding use and management of RSS / XML / etc. syndication feeds. It is called MyHeadlines by Mike Jagar, and more can be found at http://www.jmagar.com/.

Good luck.

In reply to Michelle Feldman

Re: Announcements News Feed or RSS

by Gunjan Shah -

Could anyone suggest how to show all the announcements of different courses on the same page? That is, when the student logs in he see all the announcements of different courses on the home page itself.

 

Thank You