Last active
August 29, 2015 14:23
-
-
Save rebornix/3d5d6503535196b6cd67 to your computer and use it in GitHub Desktop.
Extract information from Stack Overflow question with Noodlejs
This file contains hidden or 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
var query = { | |
url: 'http://stackoverflow.com/questions/31095166/angular-mocha-tests-fail-when-i-add-multiple-controllers-to-the-same-module', | |
type: 'html', | |
map: { | |
title: { | |
selector: "#question-header h1 a", | |
extract: "text" | |
}, | |
description: { | |
selector: ".question .postcell .post-text", | |
extract: "text" | |
}, | |
questionupvote: { | |
selector: ".question .votecell .vote-count-post", | |
extract: "text" | |
}, | |
tags: { | |
selector: ".question .postcell .post-taglist a", | |
extract: "text" | |
}, | |
answer: { | |
selector: ".accepted-answer .post-text", | |
extract: "text" | |
}, | |
anwserupvote: { | |
selector: ".accepted-answer .votecell .vote-count-post", | |
extract: "text" | |
}, | |
} | |
}, | |
uriQuery = encodeURIComponent(JSON.stringify(query)), | |
request = 'http://example.noodlejs.com/?q=' + | |
uriQuery + '&callback=?'; | |
// Make Ajax request to Noodle server | |
jQuery.getJSON(request, function (data) { | |
alert(data[0].results); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment