From 267e6922620d5cb912c9d33fd86cc8931a18487e Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Sep 01 2017 23:34:24 +0000 Subject: Initial commit. --- diff --git a/analyze-compose.py b/analyze-compose.py new file mode 100644 index 0000000..d8dfd48 --- /dev/null +++ b/analyze-compose.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python + +import sys +import requests + +import dogpile.cache + +cache = dogpile.cache.make_region().configure( + 'dogpile.cache.dbm', + expiration_time=500, + arguments=dict(filename='/var/tmp/datagrepper-cache.dbm') +) + +# Fedora-27-20170901.n.1 +target = sys.argv[-1] + +@cache.cache_on_arguments() +def get_messages(target): + url = 'https://apps.fedoraproject.org/datagrepper/raw' + params = dict( + category='pungi', + rows_per_page=100, + contains=target, + delta=1278000, + ) + response = requests.get(url, params=params) + return [m for m in response.json()['raw_messages']] + +messages = get_messages(target) +for message in messages: + print message +