{"id":19700207,"url":"https://github.com/dbeley/lastfm_pg","last_synced_at":"2026-05-11T01:46:00.214Z","repository":{"id":50193942,"uuid":"189120654","full_name":"dbeley/lastfm_pg","owner":"dbeley","description":"Generate a playlist of your top favorites tracks on lastfm and post it on twitter or mastodon.","archived":false,"fork":false,"pushed_at":"2022-12-08T07:43:38.000Z","size":80,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-13T14:28:29.559Z","etag":null,"topics":["lastfm","mastodon","twitter"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbeley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-29T00:10:34.000Z","updated_at":"2021-05-11T17:53:55.000Z","dependencies_parsed_at":"2022-09-24T07:41:05.671Z","dependency_job_id":null,"html_url":"https://github.com/dbeley/lastfm_pg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbeley%2Flastfm_pg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbeley%2Flastfm_pg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbeley%2Flastfm_pg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbeley%2Flastfm_pg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbeley","download_url":"https://codeload.github.com/dbeley/lastfm_pg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241014178,"owners_count":19894206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lastfm","mastodon","twitter"],"created_at":"2024-11-11T21:04:45.396Z","updated_at":"2026-05-11T01:45:55.185Z","avatar_url":"https://github.com/dbeley.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lastfm_pg : lastfm playlist generator\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5e1070dea74c4be1a8c1e2a083b6712f)](https://app.codacy.com/app/dbeley/lastfm_pg?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=dbeley/lastfm_pg\u0026utm_campaign=Badge_Grade_Dashboard)\n![Build Status](https://github.com/dbeley/lastfm_pg/workflows/CI/badge.svg)\n[![codecov](https://codecov.io/gh/dbeley/lastfm_pg/branch/master/graph/badge.svg)](https://codecov.io/gh/dbeley/lastfm_pg)\n\nGenerate playlist of a user's favorite most played tracks for a certain timespan and post it to mastodon.\n\nThis utility needs a valid config file with your lastfm API keys (get them at [last.fm/api](https://www.last.fm/api).) and mastodon account information in the `~/.config/lastfm_pg/config.ini` file (see `config_sample.ini` for an example).\n\nRunning the script for the first time will generate a sample config file if one doesn't exist yet.\n\nIn order to run the script at a given time, some systemd services are provided in the systemd-service directory. You will have to change them to match your configuration, more specifically the `WorkingDirectory` and `ExecStart` directive.\n\n## Requirements\n\n- pylast\n- Mastodon.py\n\n## Usage\n\nShow the help and the available options.\n\n```\nlastfm_pg -h\n```\n\n```\nusage: lastfm_pg [-h] [--debug] [--username USERNAME] [--no_upload]\n                 [--timeframe TIMEFRAME] [--social-media SOCIAL_MEDIA]\n                 [--not-only-favorites] [--config_file CONFIG_FILE]\n                 [--template_file TEMPLATE_FILE] [--hashtag HASHTAG]\n\nGenerate playlist of a user's favorite most played tracks for the last week\nand post it to mastodon.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --debug               Display debugging information\n  --username USERNAME, -u USERNAME\n                        Lastfm usernames, separated by comma (default :\n                        username section of the config.ini file).\n  --no_upload           Disable the upload. Use it for debugging.\n  --timeframe TIMEFRAME, -t TIMEFRAME\n                        Timeframe (Accepted values : 7day, 1month, 3month,\n                        6month, 12month, overall. Default : 7day).\n  --social-media SOCIAL_MEDIA, -s SOCIAL_MEDIA\n                        Social media where the playlist will be posted\n                        (mastodon or all. Default : all).\n  --not-only-favorites, -n\n                        The playlist will be composed of any tracks, not only\n                        favorite tracks.\n  --config_file CONFIG_FILE\n                        Path to the config file (Default :\n                        '~/.config/lastfm_pg/config.ini').\n  --template_file TEMPLATE_FILE\n                        Path to the template file for the tweet (Default :\n                        'tweet_template.txt').\n  --hashtag HASHTAG     Hashtag to insert at the end of each secondary tweets\n                        (Default : '#lastfm').\n```\n\n## Systemd service\n\n```\ncp systemd-service/* ~/.config/systemd/user/\nsystemctl --user daemon-reload\nsystemctl --user enable --now mastodon_lastfm_pg_weekly.timer\n```\n\n## Template\n\nThe posted tweets will follow a template. See `tweet_template.txt` for an example.\n\nAvailable variables :\n\n- timeframe\n- username\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbeley%2Flastfm_pg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbeley%2Flastfm_pg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbeley%2Flastfm_pg/lists"}