lastfm_twitter

Post top 3 artists from last.fm to Twitter.

lastfmtwitter.lastfm_twitter.get_last_fm_top_artists(secrets, args)

Return top artists from last.fm.

lastfmtwitter.lastfm_twitter.get_secrets(secret_location)

Return the secrets needed to connect to twitter and last.fm

Parameters

secret_location (str) – the folder containing the secrets.json file.

lastfmtwitter.lastfm_twitter.main()

Run the loop.

lastfmtwitter.lastfm_twitter.make_post(api, top_artists, args)

Post weekly or yearly top 3 artists to Twitter.

Parameters
  • api (cls twitter..api.Api) – The twitter API setup in the setup_twitter function.

  • top_artists (list) – contains the top artists retrieved from last.fm API.

  • args (cls argparse.Namespace) – The args from the commandline, here used to determine yr|wk

lastfmtwitter.lastfm_twitter.parse_args()

Parse the commandline arguments.

lastfmtwitter.lastfm_twitter.setup_twitter(secrets)

Return twitter API to use for post.