Last active
December 14, 2015 12:48
-
-
Save rgchris/5088457 to your computer and use it in GitHub Desktop.
Build a feed of questions AND answers from Stack Overflow 'most active' feed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REBOL [ | |
Title: "Stack Overflow Rebol Questions/Answers" | |
Date: 16-Feb-2013 | |
Author: "Christopher Ross-Gill" | |
Options: [ | |
AltXML: http://reb4.me/r3/altxml | |
Questions: http://stackoverflow.com/feeds/tag/rebol | |
Feed: http://-feed-location-/so.feed | |
] | |
] | |
options: construct system/script/header/options | |
do options/altxml | |
use [feed answers][ | |
feed: load-xml/dom options/questions | |
answers: collect [ | |
answers: feed/get-by-tag <entry> | |
clear skip answers 8 ; only the eight most active questions | |
foreach question answers [ | |
if question: find/match question/get <id> http://stackoverflow.com/q/ [ | |
question: load-xml/dom join http://stackoverflow.com/feeds/question/ question | |
foreach answer question/get-by-tag <entry> [ | |
keep answer/tree | |
] | |
] | |
] | |
] | |
insert clear feed/find-element <entry> answers | |
foreach link feed/get-by-tag <link> [ | |
if "self" = link/get #rel [ | |
insert clear link/get #href options/feed | |
] | |
] | |
feed/flatten | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment