Giter Site home page Giter Site logo

amcquade / fresh_script Goto Github PK

View Code? Open in Web Editor NEW
91.0 91.0 61.0 2.68 MB

Find Spotify tracks posted to the HipHopHeads subreddit and add them to a Spotify playlist.

License: MIT License

Python 79.08% HTML 18.82% CSS 2.11%
beginner flask good-first-issue help-wanted hiphop hiphopheads hiphopheads-subreddit music playlist python reddit reddit-crawler script spotify spotipy up-for-grabs web

fresh_script's People

Contributors

adamfitzgibbon avatar alan-llin avatar amcquade avatar chirag175 avatar degraffm0920 avatar dtcrout avatar emmakingston avatar jb-delafosse avatar joaoppc avatar johncheng2011 avatar matt-degraffenreid avatar ondkloss avatar pricebenjamin avatar roopeshvs avatar sapanpatel123 avatar skandakumaran avatar slammer23 avatar sohilnandu avatar tonydelanuez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fresh_script's Issues

move getToken to appropriate location

The User class was moved in #13 but getToken() remains in fresh_script.py. GetToken needs to be either a member function of the User class or refactored and put in the constructor.

set up logging for flask

when the server is running, it should write its outputs to a log file. research how this is done.

max tracks size

i think there is a limit to how many songs you can add to a playlist in a single request. something should be checking the size of the tracks to make sure it doesnt exceed the limit or somehow create another tracks array to be submitted in an additional request.

playlist management

give the users ability to add/remove/list the playlists they are submitting tracks to. the easiest way i can think of is by using command arguments, but a menu or something interactive might work better.

Support for adding albums

User should have a choice whether they want to include albums in the set of songs they are adding.

Consolidate configuration to a single file

Currently, fresh.py reads from three separate configuration files: .config.ini, credentials.json, and praw.ini.

To make initialization easier for new users, I propose we expect a single configuration file, config.ini (no longer hidden), with the following structure:

[spotify]
username = <username>
client_id = <client_id>
client_secret = <client_secret>
redirect_uri = <redirect_uri>

[reddit]
username = <username>
client_id = <client_id>
client_secret = <client_secret>

Note that we request the reddit username as well. This allows us to create a user-agent string that better follows the reddit API rules. (Better user-agent strings will be requested in a separate issue.)

cron examples

add one or two more examples to the readme of running the script as cron with arguments

Use cutie for menus

found this really cool menu/user input package cutie and would like to use this for use for things like managing playlists and other things.

`praw.Reddit` instance does not use a unique user-agent

The reddit API rules ask that the supplied user-agent string be

unique and descriptive, including the target platform, a unique application identifier, a version string, and your username as contact information, in the following format:
<platform>:<app ID>:<version string> (by /u/<reddit username>)

Currently, all fresh_script users have the same user-agent, defined by the createPrawConfig function:

fresh_script/fresh.py

Lines 56 to 60 in 29a482a

r_config['bot1'] = {
'client_id': client_id,
'client_secret': client_secret,
'user_agent': 'FreshScript'
}

The createPrawConfig function creates a site_name called 'bot1' in a local praw.ini file. This site_name is then used to create a praw.Reddit instance within main:

reddit = praw.Reddit('bot1')

One solution would be to override the user_agent string when creating the praw.Reddit instance:

user_agent = ' '.join([
    "Python3:FreshScript:(commit 29a482a)",
    "(by /u/<reddit_user>)",
    "(https://github.com/amcquade/fresh_script)"
])
reddit = praw.Reddit('bot1', user_agent=user_agent)

A helper function to generate the user string would be useful. We would also need to store the user's reddit username in one of the configuration files (see #62).

Find a favicon for flask

locate favicon from /r/hiphopheads, then well determine if we want to use that or create something else.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.