Moodle

Implement external blog PULL system

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.5
  • Fix Version/s: 2.0
  • Component/s: Blog
  • Labels:
    None
  • Difficulty:
    Moderate
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Issue Links

Activity

Hide
Nicolas Connault added a comment - - edited

Todo:
1. New table for external blogs: blog_external [id | userid | name | URL]
2. New admin settings: externalblogcrontime, maxexternalblogsperuser, useexternalblogs
3. Implement simple code (using magpie) for fetching and copying external blog posts
4. Implement user interface for managing external blogs
5. Use tag API for associating tags with external blogs and automatically tagging imported posts

Show
Nicolas Connault added a comment - - edited Todo: 1. New table for external blogs: blog_external [id | userid | name | URL] 2. New admin settings: externalblogcrontime, maxexternalblogsperuser, useexternalblogs 3. Implement simple code (using magpie) for fetching and copying external blog posts 4. Implement user interface for managing external blogs 5. Use tag API for associating tags with external blogs and automatically tagging imported posts
Hide
Nicolas Connault added a comment -

Added UI Mockup: <External blog management interface>

Show
Nicolas Connault added a comment - Added UI Mockup: <External blog management interface>
Hide
Nicolas Connault added a comment -

Edited UI Mockup <External blog management interface>: Removed AJAX stuff, as Tim suggested it is not needed.

Show
Nicolas Connault added a comment - Edited UI Mockup <External blog management interface>: Removed AJAX stuff, as Tim suggested it is not needed.
Hide
Martin Dougiamas added a comment -

Sorry, but now we have the settings block I think this needs to be moved in there MDL-20219

Same with general blog preferences. In fact, shouldn't they all just be on the same page?

Show
Martin Dougiamas added a comment - Sorry, but now we have the settings block I think this needs to be moved in there MDL-20219 Same with general blog preferences. In fact, shouldn't they all just be on the same page?
Hide
Nicolas Connault added a comment - - edited

This not finished. In HQ we decided to implement a one-way synchronisation process instead of the current copy-only functionality. The following remain to be done:

1. Make external entries read-only
2. Copy feed's modified date to post.timemodified
3. Change fetch_external*() to sync_external*() in blog/lib.php
4. Make external blog URL read-only after creation
5. When deleting external blog, delete related blog entries
6. When creating external blog, validate returned XML, not just valid HTTP response and content-type, but valid RSS/ATOM feed
7. On the external blog listing page, add a column with validation results (green tick / red cross)

Details of the synchronisation process:

$feed = load_feed items();
$time = earliest_timemodified_in_feed($feed);
$entries = get_blog_entries_equal_or_after_time($time);
foreach ($entries as $entry) {
    if  entry not in feed, delete it 
    if entry->timemodified != matching_feed_item->timemodified, update it
}

Thanks to Martin for the pseudocode

Show
Nicolas Connault added a comment - - edited This not finished. In HQ we decided to implement a one-way synchronisation process instead of the current copy-only functionality. The following remain to be done: 1. Make external entries read-only 2. Copy feed's modified date to post.timemodified 3. Change fetch_external*() to sync_external*() in blog/lib.php 4. Make external blog URL read-only after creation 5. When deleting external blog, delete related blog entries 6. When creating external blog, validate returned XML, not just valid HTTP response and content-type, but valid RSS/ATOM feed 7. On the external blog listing page, add a column with validation results (green tick / red cross) Details of the synchronisation process:
$feed = load_feed items();
$time = earliest_timemodified_in_feed($feed);
$entries = get_blog_entries_equal_or_after_time($time);
foreach ($entries as $entry) {
    if  entry not in feed, delete it 
    if entry->timemodified != matching_feed_item->timemodified, update it
}
Thanks to Martin for the pseudocode
Hide
Nicolas Connault added a comment -

The above pseudocode will not work, because RSS does not include any data about modified time, it only has "pubDate", which is the item's publication date.

Show
Nicolas Connault added a comment - The above pseudocode will not work, because RSS does not include any data about modified time, it only has "pubDate", which is the item's publication date.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: