-
-
Save timokau/0ea19e4bf16623962c021a54119aff1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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