Last active
December 14, 2015 22:27
Revisions
-
pierrebeaucamp revised this gist
Dec 14, 2015 . 1 changed file with 22 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,25 @@ # The MIT License (MIT) # # Copyright (c) 2015 Pierre Beaucamp <[email protected]> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. import os import requests import time -
pierrebeaucamp revised this gist
Feb 22, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ import os import requests import time import random if __name__ == "__main__": # Let's track the time @@ -25,12 +25,12 @@ def playSoundcloud(): # Gets the JSON from Soundcloud url = 'https://api.soundcloud.com/users/' + random.Random(time.time()).choice(users) + '/favorites.json?client_id=f8dc78d527a14157cce82626661b9607' r = requests.get(url) j = r.json() # Plays a Sound os.system('wget ' + j[random.Random(time.time()).randint(0, len(j))]['stream_url'] + '?client_id=f8dc78d527a14157cce82626661b9607 -O - | mplayer -cache 8192 -') while ((time.time() - start_time) < 1800): playSoundcloud() -
pierrebeaucamp revised this gist
Feb 6, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ # Let's track the time start_time = time.time() # Turns the Receiver on (ooh, he likes it) os.system("printf '%s\r\n' PO | nc 10.0.0.2 8102") time.sleep(2) os.system("printf '%s\r\n' 06FN | nc 10.0.0.2 8102") -
pierrebeaucamp revised this gist
Feb 6, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,7 +30,7 @@ def playSoundcloud(): j = r.json() # Plays a Sound os.system('wget ' + j[randint(0, len(j))]['stream_url'] + '?client_id=f8dc78d527a14157cce82626661b9607 -O - | mplayer -cache 8192 -') while ((time.time() - start_time) < 1800): playSoundcloud() -
pierrebeaucamp revised this gist
Feb 6, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ for i in range(200): os.system("printf '%s\r\b' VD | nc 10.0.0.2 8102") # Turns it on a nice Volume to wake up for i in range(50): os.system("printf '%s\r\b' VU | nc 10.0.0.2 8102") -
pierrebeaucamp created this gist
Feb 6, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ import os import requests import time from random import choice, randint if __name__ == "__main__": # Let's track the time start_time = time.time() # Turns on the Receiver (ooh, he likes it) os.system("printf '%s\r\n' PO | nc 10.0.0.2 8102") time.sleep(2) os.system("printf '%s\r\n' 06FN | nc 10.0.0.2 8102") # Nulls the Volume for i in range(200): os.system("printf '%s\r\b' VD | nc 10.0.0.2 8102") # Turns is on a nice Volume to wake up for i in range(50): os.system("printf '%s\r\b' VU | nc 10.0.0.2 8102") # Whos favorites are we listening to? users = ['5727592', '8058060'] def playSoundcloud(): # Gets the JSON from Soundcloud url = 'https://api.soundcloud.com/users/' + choice(users) + '/favorites.json?client_id=f8dc78d527a14157cce82626661b9607' r = requests.get(url) j = r.json() # Plays a Sound os.system('wget ' + j[randint(0, len(j))]['stream_url'] + '?client_id=f8dc78d527a14157cce82626661b9607' + ' -O - | mplayer -cache 8192 -') while ((time.time() - start_time) < 1800): playSoundcloud()