move lastfm into public my. package
This commit is contained in:
parent
4d02714b81
commit
d242874fa3
2 changed files with 0 additions and 0 deletions
17
my/lastfm/fill_influxdb.py
Executable file
17
my/lastfm/fill_influxdb.py
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env python3
|
||||
# pip install influxdb
|
||||
from influxdb import InfluxDBClient # type: ignore
|
||||
from my.lastfm import get_scrobbles
|
||||
|
||||
|
||||
def main():
|
||||
scrobbles = get_scrobbles()
|
||||
client = InfluxDBClient()
|
||||
# TODO client.create_database('lastfm')
|
||||
|
||||
jsons = [{"measurement": 'scrobble', "tags": {}, "time": str(sc.dt), "fields": {"name": sc.track}} for sc in scrobbles]
|
||||
client.write_points(jsons, database='lastfm')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Add table
Add a link
Reference in a new issue