Skip to content

Instantly share code, notes, and snippets.

@timokau
Created January 18, 2019 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timokau/0ea19e4bf16623962c021a54119aff1c to your computer and use it in GitHub Desktop.
Save timokau/0ea19e4bf16623962c021a54119aff1c to your computer and use it in GitHub Desktop.
#!/usr/bin/env nix-shell
#!nix-shell -i python -p "python3.withPackages (ps: with ps; [ requests beautifulsoup4 ])"
import requests
from bs4 import BeautifulSoup
for (name, url) in [
('sage unstable', 'https://hydra.nixos.org/job/nixos/trunk-combined/nixpkgs.sageWithDoc.x86_64-linux'),
('sage release ' ,'https://hydra.nixos.org/job/nixos/release-18.09/nixpkgs.sageWithDoc.x86_64-linux'),
]:
response = requests.get(url)
soup = BeautifulSoup(response.text, features="html.parser")
rows = soup.find_all('tr')[1:-1]
result = rows[0]
cols = result.find_all('td')
status = cols[0].img['alt']
build_id = cols[1].a.text
finished_at = cols[2].text
print(name, status, finished_at)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment