Issue Details (XML | Word | Printable)

Key: MDL-19683
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Nicolas Connault
Reporter: Nicolas Connault
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle
MDL-19676

Implement external blog PULL system

Created: 01/Jul/09 03:50 PM   Updated: 30/Oct/09 03:30 PM
Component/s: Blog
Affects Version/s: 1.9.5
Fix Version/s: 2.0

Issue Links:
Blockers
 

Participants: Martin Dougiamas and Nicolas Connault
Security Level: None
Difficulty: Moderate
Resolved date: 30/Oct/09
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_20_STABLE


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Nicolas Connault added a comment - 03/Jul/09 03:39 PM - 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

Nicolas Connault added a comment - 06/Jul/09 12:01 PM
Added UI Mockup: <External blog management interface>

Nicolas Connault added a comment - 06/Jul/09 12:15 PM
Edited UI Mockup <External blog management interface>: Removed AJAX stuff, as Tim suggested it is not needed.

Martin Dougiamas added a comment - 04/Sep/09 12:27 PM
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?


Nicolas Connault added a comment - 22/Oct/09 04:00 PM - 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


Nicolas Connault added a comment - 23/Oct/09 08:32 AM
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.