6 from xml.dom
import minidom
14 from pyechonest
import artist, catalog, config, playlist
18 sys.path.append(
"./7digital-python/lib/")
21 """ API Key from echonest """ 26 """API key from 7 digital""" 30 """API key from last.fm""" 34 """"*********************************************************************************""" 37 config.ECHO_NEST_API_KEY=
"SFXNKMTRAZ3ULHK6U " 40 DIGITAL7_API_KEY =
'7dbpa63h3y3d' 43 """The use of last.fm API""" 44 API_KEY =
"bd1cb09de31188b43aa46f39b8e40614" 45 API_SECRET =
"d2537b0ce8bc859a6068833c5e2a72a7" 47 """Authentication, username and password""" 49 password_hash = pylast.md5(
"123456")
50 network = pylast.LastFMNetwork(api_key = API_KEY, api_secret =
51 API_SECRET, username = username, password_hash = password_hash)
64 track_object = network.get_track(
"Adele",
"Someone like you")
66 print track_object.get_tag()
70 # track_object.add_tags(("awesome", "favorite")) # add tags to the tracks 73 #album_object = network.get_album("Adele","21") 76 #os.chdir('./Resuls/') 77 tag_classification = ["Happy"] 80 # search for similar tag according to the seeds in tag_classification 81 for tags_name in tag_classification: 83 tags = network.search_for_tag(tags_name) 85 tags_info = tags.get_next_page() 89 #tag_file_name = tags_name + "_tags_results.txt" 91 #tag_data = open(tag_file_name, 'wb') # open and write the file for top tags 93 #os.makedirs(str(tags_name)) 94 #os.chdir('./' + str(tags_name) + '/')