amcquade / fresh_script Goto Github PK
View Code? Open in Web Editor NEWFind Spotify tracks posted to the HipHopHeads subreddit and add them to a Spotify playlist.
License: MIT License
Find Spotify tracks posted to the HipHopHeads subreddit and add them to a Spotify playlist.
License: MIT License
I want to leave this issue open for anyone to make suggestions or comment on the new flask implementation of the project.
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.
Storing config information (API keys, passwords, etc.) could be troublesome if they're just plaintext on a .ini file. Maybe environment variables would be better - use os.environ.get() to fetch them and just check if they're None.
Write up instructions as to how a user might run this script as a cron job on a unix system.
when the server is running, it should write its outputs to a log file. research how this is done.
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.
you can now pass arguments to the script, instructions on how to use those need to go in the readme
add all sorting methods the api has to offer
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.
User should have a choice whether they want to include albums in the set of songs they are adding.
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.)
command line argument --fresh
When track results are returned and one of the results is clicked, all of the other cards open too
add one or two more examples to the readme of running the script as cron with arguments
supply a parameter to only add songs that meet a minimum up vote threshold
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.
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:
Lines 56 to 60 in 29a482a
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
:
Line 377 in 29a482a
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).
locate favicon from /r/hiphopheads, then well determine if we want to use that or create something else.
The user should be able to see all of their playlists not just a handful when adding more playlists
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.