{"id":16700163,"url":"https://github.com/guyzmo/pystackoverflow","last_synced_at":"2025-03-14T05:26:05.363Z","repository":{"id":137880586,"uuid":"10570869","full_name":"guyzmo/pystackoverflow","owner":"guyzmo","description":"Python library and command line utility to access resources from stackoverflow website. It's an example on how we can automagically manage the openid authentication for a client tool.","archived":false,"fork":false,"pushed_at":"2014-02-23T14:52:59.000Z","size":192,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-21T00:29:42.733Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guyzmo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-08T16:11:42.000Z","updated_at":"2014-02-23T14:52:59.000Z","dependencies_parsed_at":"2023-04-11T13:47:33.786Z","dependency_job_id":null,"html_url":"https://github.com/guyzmo/pystackoverflow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guyzmo%2Fpystackoverflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guyzmo%2Fpystackoverflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guyzmo%2Fpystackoverflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guyzmo%2Fpystackoverflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guyzmo","download_url":"https://codeload.github.com/guyzmo/pystackoverflow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243528697,"owners_count":20305467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T18:09:37.331Z","updated_at":"2025-03-14T05:26:05.341Z","avatar_url":"https://github.com/guyzmo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Stackoverflow Command Line Utility\n==================================\n\nThis utility enables access to stackoverflow websites' features. It provides\na CLI utility, but can be used as a library to access the SO websites. The\nresults of the CLI utility is pretty raw on purpose. It is meant to be used\nor extended for other programs.\n\nThis utility will connect to your stackoverflow account using either\nstackexchange's openid provider or google's one. You have to set up \nyour openid credentials in the configuration file.\n\nThen it will store your cookies (unless you don't want) so it won't\nauthenticate each time you use the utility.\n\nTo use it, you need to call a command on a stackoverflow site. To get \nthe list of the sites, you can call `sotool -l` which will return the\nlist of all sites.\n\nThen on the given site, you can use one of the following commands: `inbox` to\ndo stuff on your notification inbox, `chat` to get the chat system or `qna` for\nthe Q\u0026A system of stackoverflow.\n\nOn everycommand, you can get the list of subcommands using `--help`.\n\nUsage\n-----\n\n    usage: bin/sotool [-h] [-c FILE] [-l] [-j FILE] SITE {inbox,chat,qna} ...\n\n    Stackoverflow CLI\n\n    positional arguments:\n    SITE                  Canonical name of the targetted SO site\n    {inbox,chat,qna}      Stackoverflow commands\n        inbox               Notification inbox\n        chat                Chat commands\n        qna                 Q\u0026A commands\n\n    optional arguments:\n    -h, --help            show this help message and exit\n    -c FILE, --config FILE\n                            Specify config file\n    -l, --list            List all stackoverflow sites\n    -j FILE, --jar FILE   Specify where to store the cookies\n\nOptional arguments\n------------------\n\n * `-c/--config`: takes path to configuration file,\n * `-j/--jar`: takes path to cookies jar file,\n * `-l`: will return the list of stackoverflow sites.\n\nCommands and subcommands\n------------------------\n\nThere are three main commands which gives access to the main features of the\nstackoverflow websites:\n\n * inbox\n\nIt features tow subcommands `list` and `new`. The first one will give all your notifications\nand the second only the unseen ones.\n\n * chat\n\nit features three commands: `list` to get the list of all the chatrooms, `watch` to watch\na chatroom in live and `send` to send a message to a chatroom\n\n * qna\n\nit features two commands: `questions` will gives the list of the questions on the site\nand `answers` will get all answers for a given question.\n\nExamples\n--------\n\n * chat\n\nHere I get the list of all rooms, watch one and send a message to one\n\n    % sotool stackoverflow.com chat list\n    {   u'31218': {   'last_act': u'1d ago \\u2013balwinder',\n                    'name': u'Android Warriors',\n                    'nb_mesgs': u'45',\n                    'nb_users': u'4'},\n        u'31221': {   'last_act': u'1d ago \\u2013RSD',\n                    'name': u'CreatedByiPhone',\n                    'nb_mesgs': u'59',\n                    'nb_users': u'2'},\n        u'31241': {   'last_act': u'3d ago \\u2013 Alen Joy',\n                    'name': u'Ember.js',\n                    'nb_mesgs': u'0',\n                    'nb_users': u'0'},\n        u'31250': {   'last_act': u'3d ago \\u2013 demongolem',\n                    'name': u'Git',\n                    'nb_mesgs': u'0',\n                    'nb_users': u'0'},\n        ....\n        u'31455': {   'last_act': u'5m ago \\u2013Edward',\n                    'name': u'make div change position when other d\\u2026',\n                    'nb_mesgs': u'30',\n                    'nb_users': u'2'}}\n    % sotool stackoverflow.com chat watch 31455\n    Watching room #31455\n    ....\n            Edward: Muahahahah :-)\n            steo: Il problema \u0026#232; che un amico a cui avevo chiesto ieri alla fine ha risposto\n            steo: e me l\u0026#39;aveva chiesto lui ahaha\n            steo: non ti preoccupare non scervellarti pi\u0026#249; di tanto\n            steo: ti upvoto ;)\n            Edward: Ahahah ok, no problem e buon lavoro!\n    ^C\n    % sotool stackoverflow.com chat send 'Hello world!'\n\n * qna\n\nNow we get the list of three newest questions, and then we look at the full message and answers for the newest one\n\n    % bin/sotool stackoverflow.com qna questions -s newest -n 3\n    [   {   'answs': u'0',\n            'id': u'17001321',\n            'summary': u'I have a Opencv C++ module, this module is extended to python - \\n\\n%include \"cv.h\"\\nusing namespace cv;\\nstatic PyObject* getcordFunc(PyObject *self, PyObject *args) {\\n    VideoCapture cap(0);\\n    return ...',\n            'tags': [u'c++', u'python', u'opencv'],\n            'title': u'Extending Python: returning C++ object',\n            'url': u'/questions/17001321/extending-python-returning-c-object',\n            'user': u'Anirudh',\n            'views': u'2',\n            'votes': u'0'},\n        {   'answs': u'0',\n            'id': u'17001320',\n            'summary': u\"I'm sorry if it's too stupid question. I cannot find the answer. I know C++ but I always have troubles with external libraries etc. \\n\\nI don't have much time but I must use Boost test to test my ...\",\n            'tags': [u'c++', u'unit-testing', u'testing', u'boost', u'library'],\n            'title': u'Boost test - every suite in other file',\n            'url': u'/questions/17001320/boost-test-every-suite-in-other-file',\n            'user': u'user2466619',\n            'views': u'3',\n            'votes': u'0'},\n        {   'answs': u'0',\n            'id': u'17001318',\n            'summary': u\"I'm using cURL for Codeigniter to talk to a RESTFUL Service and using the HTTP verbs to create my methods i.e user_get, user_post _get, _post being the verbs names\\n\\nI am trying to post some data but ...\",\n            'tags': [u'php', u'codeigniter'],\n            'title': u'Codeigniter cURL Post sending as Get',\n            'url': u'/questions/17001318/codeigniter-curl-post-sending-as-get',\n            'user': u'user1074242',\n            'views': u'3',\n            'votes': u'0'}]\n    % bin/sotool stackoverflow.com qna answers 17001321\n    {   'answers': [],\n        'question': {   'comments': [],\n                        'favos': u'',\n                        'tags': ([u'c++', u'python', u'opencv'],),\n                        'text': u'I have a Opencv C++ module, this module is extended to python -\\n\\n    \\n    %include \"cv.h\"\\n    using namespace cv;\\n    static PyObject* getcordFunc(PyObject *self, PyObject *args) {\\n        VideoCapture cap(0);\\n        return Py_BuildValue(\"O\", cap);\\n    }\\n    //Followed by other functions required for Extending...\\n    \\n\\nI there any way to return the object cap back to the python program. I am\\ndoing it so that I can pass to another extended methond.\\n\\n',\n                        'title': u'Extending Python: returning C++ object',\n                        'users': [   {   'avatar': u'http://www.gravatar.com/avatar/5046948fad5679c3713fd5e8e849e271?s=32\u0026d=identicon\u0026r=PG',\n                                        'last_edit': u'2013-06-08 16:01:17Z',\n                                        'owner': True,\n                                        'reputation': u'173',\n                                        'username': u'Anirudh'}],\n                        'votes': u'0'}}\n\n * inbox\n\nNow we get the notifications:\n\n    % bin/sotool stackoverflow.com inbox new\n    []\n    % bin/sotool stackoverflow.com inbox list\n    [   {   u'Count': 1,\n            u'CreationDate': u'16 hours ago',\n            u'FaviconUrl': u'http://cdn.sstatic.net/stackoverflow/img/favicon.ico',\n            u'IsNew': False,\n            u'SiteUrl': u'stackoverflow.com',\n            u'Summary': u'@zmo and @RyanSaxe asked for a xattr -l. Do it.  I\u0026#39;m not a Mac user, but I know that the file...',\n            u'Title': u'why are my created files hidden?',\n            u'Type': u'comment',\n            u'Url': u'http://stackoverflow.com/posts/comments/24553594?noredirect=1'},\n        {   u'Count': 1,\n            u'CreationDate': u'23 hours ago',\n            u'FaviconUrl': u'http://cdn.sstatic.net/stackoverflow/img/favicon.ico',\n            u'IsNew': False,\n            u'SiteUrl': u'stackoverflow.com',\n            u'Summary': u'I did try with Request changing the r to upper case but it still gives the same error',\n            u'Title': u'Error in Python2.7 takes exactly 2 arguments (1 given)',\n            u'Type': u'comment',\n            u'Url': u'http://stackoverflow.com/posts/comments/24542986?noredirect=1'},\n    ....\n\nLICENSE\n-------\n\nGNU GPLv3 see LICENSE file\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguyzmo%2Fpystackoverflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguyzmo%2Fpystackoverflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguyzmo%2Fpystackoverflow/lists"}