Permalink
Browse files

minor updates

  • Loading branch information...
1 parent 21dc76d commit aa0ccdadf7a6a4c0fdeadf7d84cdbf92c11fb2e3 @rsms committed Jul 13, 2010
Showing with 29 additions and 22 deletions.
  1. +6 −0 README.md
  2. +21 −21 buzz-collector/main.py
  3. +2 −1 run.sh
View
@@ -30,6 +30,12 @@ Now, it's time to setup and start the machine.
If everything works (yeah, right...) you should see new tracks popping up in the playlist (when observed in a Spotify client). Status and error messages will be printed to the terminal.
+*Tip:* If you want to keep the playlist up to date by having the script running "autonomously", you can use the `run-loop.sh` wrapper and `nohup` like this:
+
+ nohup ./run-loop.sh &
+
+And you can now log out from the terminal and the program will continue to run.
+
## MIT license
Copyright (c) 2010 Erik Hartwig & Rasmus Andersson
View
@@ -87,27 +87,27 @@ def main():
buzz_query = "open.spotify.com"
if query:
buzz_query = "%s %s" % (buzz_query, query)
- if True:
- for result in buzz_client.search(query=buzz_query):
- # if result.geocode:
- # print result.geocode
- # print result.actor
- # for x in dir(result):
- # print "%s %s" % (x, str(getattr(result, x)))
- if result.id in seen:
- continue
- # for x in dir(result):
- # print "%s: %s" % (x, str(getattr(result, x)))
- # return 0
- seen.add(result.id)
- link = getSpotifyLink(result)
- if link:
- addLink(link)
- continue
- m = _SPOTIFY_RE.match(result.content)
- if m:
- addLink(m.group(1))
- time.sleep(1)
+ #if True:
+ for result in buzz_client.search(query=buzz_query):
+ # if result.geocode:
+ # print result.geocode
+ # print result.actor
+ # for x in dir(result):
+ # print "%s %s" % (x, str(getattr(result, x)))
+ if result.id in seen:
+ continue
+# for x in dir(result):
+# print "%s: %s" % (x, str(getattr(result, x)))
+# return 0
+ seen.add(result.id)
+ link = getSpotifyLink(result)
+ if link:
+ addLink(link)
+ continue
+ m = _SPOTIFY_RE.match(result.content)
+ if m:
+ addLink(m.group(1))
+ #time.sleep(1)
return 0
if __name__ == '__main__':
View
3 run.sh
@@ -12,5 +12,6 @@ SPOTIFY_PLAYLIST_NAME='Buzzing'
for f in $(python buzz-collector/main.py -k "$BUZZ_KEY" -s "$BUZZ_SECRET"); do
spotify-updater/push2playlist \
- "$SPOTIFY_USER" "$(cat $SPOTIFY_PASSWD_FILE)" "$SPOTIFY_PLAYLIST_NAME" $f || break
+ "$SPOTIFY_USER" "$(cat $SPOTIFY_PASSWD_FILE)" "$SPOTIFY_PLAYLIST_NAME" $f \
+ || exit $?
done

0 comments on commit aa0ccda

Please sign in to comment.