NC_HOST="gamma"
NC_PORT=1234
CHANNEL=94.3

import os          # to execute shell commands
import sys         # arguments
import json        # json parsing
import urllib2     # url parsing and downloading

if not len(sys.argv) > 1:
	print('Usage: ' + sys.argv[0] + ' <search term>')
	exit(1)

json_url    = urllib2.urlopen("http://ex.fm/api/v3/song/search/%s"% "+".join(sys.argv[1:]))
parsed_json = json.loads(json_url.read())
song_url    = parsed_json["songs"][0]["url"]

os.system("wget -O - " + song_url + " | nc " + str(NC_HOST) + " " + str(NC_PORT))

NC_HOST="gamma"
NC_PORT=1234

import os          # to execute shell commands
import sys         # arguments
import json        # json parsing
import urllib2     # url parsing and downloading

if not len(sys.argv) > 1:
	print('Usage: ' + sys.argv[0] + ' <search term>')
	exit(1)

json_url    = urllib2.urlopen("http://ex.fm/api/v3/song/search/%s"% "+".join(sys.argv[1:]))
parsed_json = json.loads(json_url.read())
song_url    = parsed_json["songs"][0]["url"]

os.system("wget -O - " + song_url + " | nc " + str(NC_HOST) + " " + str(NC_PORT))

Remove CHANNEL. Why is it even there?
Remove CHANNEL. Why is it even there?

  NC_HOST="gamma"
  NC_PORT=1234
- CHANNEL=94.3
  
  import os          # to execute shell commands
  import sys         # arguments
  import json        # json parsing
  import urllib2     # url parsing and downloading
  
  if not len(sys.argv) > 1:
  	print('Usage: ' + sys.argv[0] + ' <search term>')
  	exit(1)
  
  json_url    = urllib2.urlopen("http://ex.fm/api/v3/song/search/%s"% "+".join(sys.argv[1:]))
  parsed_json = json.loads(json_url.read())
  song_url    = parsed_json["songs"][0]["url"]
  
  os.system("wget -O - " + song_url + " | nc " + str(NC_HOST) + " " + str(NC_PORT))
  
Remove CHANNEL. Why is it even there?
## Code Before:
NC_HOST="gamma"
NC_PORT=1234
CHANNEL=94.3

import os          # to execute shell commands
import sys         # arguments
import json        # json parsing
import urllib2     # url parsing and downloading

if not len(sys.argv) > 1:
	print('Usage: ' + sys.argv[0] + ' <search term>')
	exit(1)

json_url    = urllib2.urlopen("http://ex.fm/api/v3/song/search/%s"% "+".join(sys.argv[1:]))
parsed_json = json.loads(json_url.read())
song_url    = parsed_json["songs"][0]["url"]

os.system("wget -O - " + song_url + " | nc " + str(NC_HOST) + " " + str(NC_PORT))

## Instruction:
Remove CHANNEL. Why is it even there?
## Code After:
NC_HOST="gamma"
NC_PORT=1234

import os          # to execute shell commands
import sys         # arguments
import json        # json parsing
import urllib2     # url parsing and downloading

if not len(sys.argv) > 1:
	print('Usage: ' + sys.argv[0] + ' <search term>')
	exit(1)

json_url    = urllib2.urlopen("http://ex.fm/api/v3/song/search/%s"% "+".join(sys.argv[1:]))
parsed_json = json.loads(json_url.read())
song_url    = parsed_json["songs"][0]["url"]

os.system("wget -O - " + song_url + " | nc " + str(NC_HOST) + " " + str(NC_PORT))
