jsonsoftwarefillerupper.py 991 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/env python
  2. # This is supposed to help automate the process of adding software to
  3. # FreeAlternatives
  4. # GETTING DATA FROM:
  5. # - alternativeto
  6. # - github
  7. # - wikipedia
  8. # WHAT WE NEED:
  9. # - names
  10. # - comment
  11. # - links
  12. # - git (if possible)
  13. # - wikipedia (if possible)
  14. # - documentation (if possible)
  15. # - icon
  16. # - license
  17. # - platforms
  18. # - interface
  19. # - languages
  20. # - networks read (if possible)
  21. # - networks write (if possible)
  22. # - formats read (if possible)
  23. # - formats write (if possible)
  24. # - genaric name
  25. import requests
  26. import json
  27. headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20121201 icecat/17.0.1'}
  28. software = "gnu_emacs"
  29. wikipedia_api_url = f"https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&rvsection=0&titles={software}&format=json"
  30. data = requests.get(wikipedia_api_url).json()
  31. # https://en.wikipedia.org/?curid=18933234
  32. for page in data["query"]["pages"]:
  33. print(page)
  34. #id = data["query"]["pages"]["