Skip to content

duyhdb/stackoverflow-top-qa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 

Repository files navigation

Stackoverflow Top Questions & Answers―Crawler

A script get the highest voted questions from StackOverflow.com and print its best anwser url.

Table of Contents

General info

This tool is a part of project I learnt about crawler.

Technologies

Project is created with:

  • Python version: 3.8.10
  • Stack Exchange API version: 2.3

Learn more about latest API version.

Requirement

  • stackoverflow API key store in config file (i.e. myconfig.cfg) located in the same directory of this script.

As document said, an API key is NOT compulsory to retrieve question/answer, but for more API quota in this case.

If an application does have an access_token, then the application is on a distinct user/app pair daily quota (default size of 10,000).

Register an API key.

Setup

To run this project, spin up terminal locally:

$ cd ../stackoverflow-top-qa
$ python3 stackoverflow.py [N] [LABEL]

Demo

$ python3 stackoverflow.py 4 python

Result

  1. What does the "yield" keyword do?
    https://stackoverflow.com/questions/231767/what-does-the-yield-keyword-do#231855
  2. What does if name == "main": do?
    https://stackoverflow.com/questions/419163/what-does-if-name-main-do#419185
  3. Does Python have a ternary conditional operator?
    https://stackoverflow.com/questions/394809/does-python-have-a-ternary-conditional-operator#394814
  4. What are metaclasses in Python?
    https://stackoverflow.com/questions/100003/what-are-metaclasses-in-python#6581949

About

A script get the highest voted questions from StackOverflow.com and print its best anwser url.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages