Skip to content

Commit

Permalink
start dealing with user pages
Browse files Browse the repository at this point in the history
  • Loading branch information
EffinMaggie committed Sep 29, 2014
1 parent 5c834db commit e395de5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/reave.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

var reave = require('../lib/reave.js');

reave.medium(process.argv[2], console.log);
reave[process.argv[2]](process.argv[3], console.log);
16 changes: 15 additions & 1 deletion lib/reave.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,20 @@ function medium (URL, pageCallback) {
});
}

function mediumUser (URL, pageCallback) {
fetch(https, URL, function(text) {
var out = cheerio.load('<feed xmlns="http://www.w3.org/2005/Atom"><id>'+URL+'</id></feed>');

var $ = cheerio.load(text);
var user = $('meta[property="profile:username"]').attr('content');

$('h3 a[href^="/@'+user+'"]').each(function(_, e) {
console.log($(this).attr('href'));
});
});
}

module.exports = {
'medium': medium
'medium': medium,
'mediumUser': mediumUser
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reave",
"version": "0.1.3",
"version": "0.2.0",
"description": "Scripts to fetch and simplify blog content.",
"keywords": [
"cli",
Expand Down

0 comments on commit e395de5

Please sign in to comment.