Skip to content

Instantly share code, notes, and snippets.

@oprypin
Last active February 6, 2016 16:27
Show Gist options
  • Save oprypin/a00c52b36f6eb7a60211 to your computer and use it in GitHub Desktop.
Save oprypin/a00c52b36f6eb7a60211 to your computer and use it in GitHub Desktop.
Games confirmed working on Linux without a SteamOS icon on Steam
import time
import requests
import lxml.html
import cssselect
page = 1
apps = {}
tries = 0
while tries < 5:
tries += 1
print(' ', page, tries if tries > 1 else ' ', end='\r')
resp = requests.get('http://store.steampowered.com/search/results', params=dict(
sort_by='Name_ASC', category1=998, page=page
))
if "No results were returned for that query." in resp.text:
time.sleep(5)
continue
root = lxml.html.fromstring(resp.text)
for a in root.cssselect('a.search_result_row'):
title = a.cssselect('span.title')[0].text
app_id = int(a.get('data-ds-appid'))
if not a.cssselect('.linux'):
apps[app_id] = title
if root.cssselect('a.search_result_row'):
tries = 0
page += 1
with open('nonlinux.pon', 'w') as f:
print(apps, file=f)
import json
import ast
import requests
resp = requests.get('https://raw.githubusercontent.com/SteamDatabase/SteamLinux/master/GAMES.json')
linux = json.loads(resp.text)
with open('nonlinux.pon') as f:
nonlinux = ast.literal_eval(f.read())
linux = {int(aid): info.get('Comment') if isinstance(info, dict) else None for aid, info in linux.items()}
for aid, title in sorted(nonlinux.items(), key=lambda p: p[1]):
if aid in linux:
print("- [{title}](http://store.steampowered.com/app/{aid})".format_map(locals()))
print(" **[C](http://steamcommunity.com/app/{aid}/discussions/search/?q=linux) [H](https://steamdb.info/app/{aid}/history/)**".format_map(locals()), end='')
if linux[aid]:
print(" | {}".format(linux[aid]), end='')
print()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment