On 11/03/13 10:02, Elisiano Petrini wrote:
> Hi,
> they do have an API ( https://api.stackexchange.com/docs/ ) but I
> couldn't find an updated python library for it (py-stockexchange reads
> 1.1 API version whereas the latest is 2.1).
>
> Nonetheless, their API return json data, hence you can very easily parse
> it with python (or whatever other language supporting json).
>
> To see the kind of json returned (or tune the query) you can visit
> https://api.stackexchange.com/docs/search#order=desc&sort=creation&tagged=couchdb&filter=default&site=stackoverflow&run=true
>
> This is a very simple example of how to put the pieces together in
> python (far from being usable in production, but already useful to avoid
> manual searches):
>
> [elisiano@pc-elisiano ~/Projects ]$ cat couchdb_stack_overflow.py
> #!/usr/bin/env python2
>
> import urllib2
> from StringIO import StringIO
> import gzip
> import json
>
> url="""https://api.stackexchange.com/2.1/search?order=desc&sort=creation&tagged=couchdb&site=stackoverflow"""
>
> req=urllib2.Request(url)
> req.add_header('Accept-Encoding', 'gzip') # should be the default
>
> res=urllib2.urlopen(req)
>
> buf=StringIO(res.read())
> f=gzip.GzipFile(fileobj=buf)
> data=json.loads(f.read())
>
> ### print only unanswered questions
> for question in data['items']:
> if not question['is_answered']:
> print "%s => %s" % (question['title'], question['link'])
>
>
>
> [elisiano@pc-elisiano ~/Projects ]$ ./couchdb_stack_overflow.py
> couchdb map/reduce view: counting only the most recent items =>
> http://stackoverflow.com/questions/15320834/couchdb-map-reduce-view-counting-only-the-most-recent-items
> couchDB sorting complex key =>
> http://stackoverflow.com/questions/15259910/couchdb-sorting-complex-key
> How to specify individual database location in couchdb? =>
> http://stackoverflow.com/questions/15236632/how-to-specify-individual-database-location-in-couchdb
> Query Ad-Hoc (Temporary) Views with ektorp =>
> http://stackoverflow.com/questions/15220020/query-ad-hoc-temporary-views-with-ektorp
> Google closure on CouchDB =>
> http://stackoverflow.com/questions/15212983/google-closure-on-couchdb
> couchdb conflict identical document =>
> http://stackoverflow.com/questions/15208208/couchdb-conflict-identical-document
> What database(s) for storing user data, and also support targeting
> queries? =>
> http://stackoverflow.com/questions/15177068/what-databases-for-storing-user-data-and-also-support-targeting-queries
> CouchDB Security in a Lightweight Stack? =>
> http://stackoverflow.com/questions/15163643/couchdb-security-in-a-lightweight-stack
> CouchDB: synchronize between slave databases =>
> http://stackoverflow.com/questions/15159186/couchdb-synchronize-between-slave-databases
> CouchDB "virtual" database, that combines 2 databases into 1
> =>
> http://stackoverflow.com/questions/15158869/couchdb-virtual-database-that-combines-2-databases-into-1
> CouchDB didn't start in Windows XP? Anybody has same experince? =>
> http://stackoverflow.com/questions/15142066/couchdb-didnt-start-in-windows-xp-anybody-has-same-experince
> How to retrieve the couchDB data by given limit(start_limit,end_limit)
> using cradle in node.js? =>
> http://stackoverflow.com/questions/15105002/how-to-retrieve-the-couchdb-data-by-given-limitstart-limit-end-limit-using-cra
>
>
>
>
>
>
> On Sat, 2013-03-09 at 11:08 -0800, Mark Hahn wrote:
>> Is this automated? If not then it should be. I assume stackoverflow has
>> an api.
>>
>>
>> On Sat, Mar 9, 2013 at 6:17 AM, Noah Slater <nslater@apache.org> wrote:
>>
>>> Dear community,
>>>
>>> Here are the latest StackOverflow questions about CouchDB. These might be a
>>> good opportunity to earn some StackOverflow reputation and help out the
>>> wider CouchDB community at the same time!
>>>
>>> CouchDB Security in a Lightweight Stack?
>>>
>>> http://stackoverflow.com/questions/15163643/couchdb-security-in-a-lightweight-stack
>>>
>>> CouchDB didn't start in Windows XP? Anybody has same experince? [closed]
>>>
>>> http://stackoverflow.com/questions/15142066/couchdb-didnt-start-in-windows-xp-anybody-has-same-experince
>>>
>>> Thanks,
>>>
>>> --
>>> NS
>>>
>
>
>
Analysis of StackOverflow api output JSON via Erlang view and map-reduce of the key value
structure in Erlang terms.
This outputs what is emitted by the erlang view of the JSON
program code at Re: Using the Erlang view server to Educate in CouchDB
Key, Grouping Reduce on exact Value
first 2 of 29 answers to "erlang" and "couchdb"
Mon 11 Mar 2013 11:06:35 GMT
[["_id"], "04d7a389c5335d2c22c993b7e830816e"] 1
[["_id"], "04d7a3d7abd825c55cc06f5025557420"] 1
[["_rev"], "1-27e61d976ff7989cae2965eb2a56703e"] 1
[["_rev"], "1-361ec33082b9208e612ac5af3fcb1d6e"] 1
[["has_more"], true] 2
[["items", [0], "answer_count"], 0] 2
[["items", [0], "creation_date"], 1362908290] 1
[["items", [0], "creation_date"], 1362996678] 1
[["items", [0], "is_answered"], false] 2
[["items", [0], "last_activity_date"], 1362919660] 1
[["items", [0], "last_activity_date"], 1362998116] 1
[["items", [0], "last_edit_date"], 1362919660] 1
[["items", [0], "last_edit_date"], 1362998116] 1
[["items", [0], "link"], "http://stackoverflow.com/questions/15320834/couchdb-map-reduce-view-counting-only-the-most-recent-items"]
1
[["items", [0], "link"], "http://stackoverflow.com/questions/15335898/export-data-from-mnesia-to-excel"]
1
[["items", [0], "owner", "accept_rate"], 0] 1
[["items", [0], "owner", "display_name"], "francoi mocci"] 1
[["items", [0], "owner", "display_name"], "wasperen"] 1
[["items", [0], "owner", "link"], "http://stackoverflow.com/users/2095691/francoi-mocci"]
1
[["items", [0], "owner", "link"], "http://stackoverflow.com/users/2153440/wasperen"]
1
[["items", [0], "owner", "profile_image"], "http://www.gravatar.com/avatar/8dc5891d8dbe48ed1580a66aab57c09b?d=identicon&r=PG"]
1
[["items", [0], "owner", "profile_image"], "http://www.gravatar.com/avatar/b9331d61a59e58b9de331a4e6c0dd475?d=identicon&r=PG"]
1
[["items", [0], "owner", "reputation"], 6] 2
[["items", [0], "owner", "user_id"], 2095691] 1
[["items", [0], "owner", "user_id"], 2153440] 1
[["items", [0], "owner", "user_type"], "registered"] 2
[["items", [0], "question_id"], 15320834] 1
[["items", [0], "question_id"], 15335898] 1
[["items", [0], "score"], 0] 1
[["items", [0], "score"], 1] 1
[["items", [0], "tags", [0]], "excel"] 1
[["items", [0], "tags", [0]], "mapreduce"] 1
[["items", [0], "tags", [1]], "couchdb"] 1
[["items", [0], "tags", [1]], "erlang"] 1
[["items", [0], "tags", [2]], "mnesia"] 1
[["items", [0], "title"], "couchdb map/reduce view: counting only the most recent items"]
1
[["items", [0], "title"], "export data from mnesia to excel"] 1
[["items", [0], "view_count"], 10] 1
[["items", [0], "view_count"], 14] 1
[["items", [1], "accepted_answer_id"], 15321245] 1
[["items", [1], "answer_count"], 1] 1
[["items", [1], "answer_count"], 2] 1
[["items", [1], "creation_date"], 1362907130] 1
[["items", [1], "creation_date"], 1362932917] 1
[["items", [1], "is_answered"], true] 2
[["items", [1], "last_activity_date"], 1362911343] 1
[["items", [1], "last_activity_date"], 1362938582] 1
[["items", [1], "last_edit_date"], 1362907356] 1
[["items", [1], "link"], "http://stackoverflow.com/questions/15320693/using-couchdb-as-interface-is-it-appropriate-way"]
1
[["items", [1], "link"], "http://stackoverflow.com/questions/15324572/erlang-orddictsize-function-for-record"]
1
[["items", [1], "owner", "accept_rate"], 76] 1
[["items", [1], "owner", "accept_rate"], 97] 1
[["items", [1], "owner", "display_name"], "lost_with_coding"] 1
[["items", [1], "owner", "display_name"], "Valentin Heinitz"] 1
[["items", [1], "owner", "link"], "http://stackoverflow.com/users/298206/valentin-heinitz"]
1
[["items", [1], "owner", "link"], "http://stackoverflow.com/users/513034/lost-with-coding"]
1
[["items", [1], "owner", "profile_image"], "http://www.gravatar.com/avatar/2911c6ad709ff05272e49a21df247da2?d=identicon&r=PG"]
1
[["items", [1], "owner", "profile_image"], "http://www.gravatar.com/avatar/713b314a279977bd57a97b13c6e3c954?d=identicon&r=PG"]
1
[["items", [1], "owner", "reputation"], 506] 1
[["items", [1], "owner", "reputation"], 636] 1
[["items", [1], "owner", "user_id"], 298206] 1
[["items", [1], "owner", "user_id"], 513034] 1
[["items", [1], "owner", "user_type"], "registered"] 2
[["items", [1], "question_id"], 15320693] 1
[["items", [1], "question_id"], 15324572] 1
[["items", [1], "score"], 0] 1
[["items", [1], "score"], 2] 1
[["items", [1], "tags", [0]], "erlang"] 1
[["items", [1], "tags", [0]], "interface"] 1
[["items", [1], "tags", [1]], "couchdb"] 1
[["items", [1], "tags", [1]], "size"] 1
[["items", [1], "tags", [2]], "mustache"] 1
[["items", [1], "tags", [2]], "record"] 1
[["items", [1], "tags", [3]], "ordereddictionary"] 1
[["items", [1], "title"], "Erlang: orddict:size() function for record?"] 1
[["items", [1], "title"], "Using CouchDB as interface. Is it appropriate way?"] 1
[["items", [1], "view_count"], 23] 1
[["items", [1], "view_count"], 27] 1
[["items", [2], "accepted_answer_id"], 15318766] 1
[["items", [2], "answer_count"], 1] 2
[["items", [2], "creation_date"], 1362887368] 1
[["items", [2], "creation_date"], 1362913090] 1
[["items", [2], "is_answered"], true] 2
[["items", [2], "last_activity_date"], 1362887951] 1
[["items", [2], "last_activity_date"], 1362916747] 1
[["items", [2], "link"], "http://stackoverflow.com/questions/15318711/how-do-i-add-a-new-key-value-pair-to-couchdb-using-cradle-node-js"]
1
[["items", [2], "link"], "http://stackoverflow.com/questions/15321466/erlang-using-gb-tree-functions-within-beam-executable-record-operations"]
1
[["items", [2], "owner", "accept_rate"], 80] 1
[["items", [2], "owner", "accept_rate"], 97] 1
[["items", [2], "owner", "display_name"], "lost_with_coding"] 1
[["items", [2], "owner", "display_name"], "streetlight"] 1
[["items", [2], "owner", "link"], "http://stackoverflow.com/users/1209702/streetlight"]
1
[["items", [2], "owner", "link"], "http://stackoverflow.com/users/513034/lost-with-coding"]
1
[["items", [2], "owner", "profile_image"], "http://www.gravatar.com/avatar/6385b493b6448615358774f4df3982cd?d=identicon&r=PG"]
1
[["items", [2], "owner", "profile_image"], "http://www.gravatar.com/avatar/713b314a279977bd57a97b13c6e3c954?d=identicon&r=PG"]
1
[["items", [2], "owner", "reputation"], 506] 1
[["items", [2], "owner", "reputation"], 577] 1
[["items", [2], "owner", "user_id"], 513034] 1
[["items", [2], "owner", "user_id"], 1209702] 1
[["items", [2], "owner", "user_type"], "registered"] 2
--
David Martin
|