Page 2 of 3

Posted: Mon Jan 30, 2006 8:49 am
by onkel_enno
I think the + "&go=Go" is unnecessary.

@Sammy
Could you please remove your code from your posts if you solved all problems - for the clearness. Thx

Posted: Mon Jan 30, 2006 8:53 am
by Lowlander
If you want to do an album search you'll need to change album to:

Code: Select all

Album = Replace(Song.AlbumName, " ", "")
and the WshShell.Run to:

Code: Select all

WshShell.Run("http://www.allmusic.com/cg/amg.dll?P=amg&OPT1=2&SQL=" + Album) 

Posted: Wed Feb 01, 2006 10:28 am
by judas
Lowlander, you're almost right in those replace lines for allmusic.com...but the spaces need to be replaced by a "+" not blank "", so the correct syntax is:

Code: Select all

      Artist = Replace(Song.ArtistName, " ", "+") 
      Album = Replace(Song.AlbumName, " ", "+")
there you go, and thanks for the help!!

btw...I'm having problems with artists that have a & in their name, like Hootie & THE BLOWFISH, as allmusic.com doesnt seem to understand the &. if & is replaced by AND it works, but i had no luck doing this in the script as replacing & breaks the string...it sure is how the language handles '&'

can you help me on that one please??

thanks,


judas

Posted: Wed Feb 01, 2006 10:44 am
by trixmoto
Try:

Code: Select all

Artist = Replace(Song.ArtistName,"&","%26")
This is how most weblinks work (26 is the hexidecimal value for the & character).

Posted: Wed Feb 01, 2006 10:59 am
by judas
still no luck...it's breaking the string and the urls its sending to the browser is:

Code: Select all

http://www.allmusic.com/cg/amg.dll?P=amg&uid=SEARCH&opt1=1&sql=HOOTIE
one question: is this correct?

Code: Select all

      Artist = Replace(Song.ArtistName, " ", "+")
      Artist = Replace(Song.ArtistName,"&","%26")
      Album = Replace(Song.AlbumName, " ", "+")
thanks trix

Posted: Wed Feb 01, 2006 11:24 am
by trixmoto
Turns out allmusic are a bit non-standard and simply use % to represent &, so this should work:

Code: Select all

Artist = Replace(Song.ArtistName,"&","%")

Posted: Tue Mar 14, 2006 10:57 pm
by MarineBrat
Has anyone bundled this up into a complete script yet?

Posted: Tue Mar 14, 2006 11:01 pm
by judas
@Marinebrat
This is what i use to get info from artist or album from allmusic.com

Just put the script (*.vbs) on mediamonkey\scripts\auto folder...and restart the monkey

Code: Select all

Sub OnStartUp 
   SDB.UI.AddMenuItemSep SDB.UI.Menu_Pop_TrackList_MoreFrom, -1, -1 
   SDB.UI.AddMenuItemSep SDB.UI.Menu_Pop_NP_MoreFrom, -1, -1 
    
   Dim MenuItem 
   Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_TrackList_MoreFrom, -1, -1) 
   MenuItem.Caption = SDB.Localize("Artist") + " (allmusic.com)" 
   MenuItem.IconIndex = 37 
   MenuItem.OnClickFunc = "allmusic" 
   MenuItem.UseScript = Script.ScriptPath 
   MenuItem.Hint = "Artist" 
    
   Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_NP_MoreFrom, -1, -1) 
   MenuItem.Caption = SDB.Localize("Artist") + " (allmusic.com)" 
   MenuItem.IconIndex = 37 
   MenuItem.OnClickFunc = "allmusic" 
   MenuItem.UseScript = Script.ScriptPath 
   MenuItem.Hint = "Artist" 
    
   Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_TrackList_MoreFrom, -1, -1) 
   MenuItem.Caption = SDB.Localize("Album") + " (allmusic.com)" 
   MenuItem.IconIndex = 37 
   MenuItem.OnClickFunc = "allmusic" 
   MenuItem.UseScript = Script.ScriptPath 
   MenuItem.Hint = "Album" 
    
   Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_NP_MoreFrom, -1, -1) 
   MenuItem.Caption = SDB.Localize("Album") + " (allmusic.com)" 
   MenuItem.IconIndex = 37 
   MenuItem.OnClickFunc = "allmusic" 
   MenuItem.UseScript = Script.ScriptPath 
   MenuItem.Hint = "Album" 
    
   Set MenuItem = Nothing 
End Sub 

Sub allmusic(MenuItem) 
   if SDB.SelectedSongList.Count > 0 then 
      Dim Song 
      Set Song = SDB.SelectedSongList.Item(0) 
      Dim Artist 
      Dim Album 
    
      Artist = Replace(Song.ArtistName, " ", "+")
      Artist = Replace(Artist,"&","%")
      Album = Replace(Song.AlbumName, " ", "+")
      Album = Replace(Album,"&","%")
       
      Dim WshShell 
      Set WshShell = CreateObject("WScript.Shell") 
      if MenuItem.Hint = "Artist" then 
         WshShell.Run("http://www.allmusic.com/cg/amg.dll?P=amg&uid=SEARCH&opt1=1&sql=" + Artist) 
      else 
         WshShell.Run("http://www.allmusic.com/cg/amg.dll?P=amg&uid=SEARCH&opt1=2&sql=" + Album) 
      end if 
      Set WshShell = Nothing 
   end if 
end Sub
hope is what ur looking for...


judas

Posted: Wed Mar 15, 2006 4:31 am
by kanski
Good!
Please upgrade this script to get info from ALL POSSIBLE SITES. It's real?

Posted: Wed Mar 15, 2006 6:07 am
by trixmoto
Define "all possible sites" :-?

Posted: Wed Mar 15, 2006 6:26 am
by kanski
2trixmoto:

Code: Select all


Sub OnStartUp
   SDB.UI.AddMenuItemSep SDB.UI.Menu_Pop_TrackList_MoreFrom, -1, -1
   SDB.UI.AddMenuItemSep SDB.UI.Menu_Pop_NP_MoreFrom, -1, -1
   
   Dim MenuItem
   Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_TrackList_MoreFrom, -1, -1)
   MenuItem.Caption = SDB.Localize("Album") + " [allmusic.com]"
   MenuItem.IconIndex = 37
   MenuItem.OnClickFunc = "allmusic"
   MenuItem.UseScript = Script.ScriptPath
   MenuItem.Hint = "Album"
   
   Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_NP_MoreFrom, -1, -1)
   MenuItem.Caption = SDB.Localize("Album") + " [allmusic.com]"
   MenuItem.IconIndex = 37
   MenuItem.OnClickFunc = "allmusic"
   MenuItem.UseScript = Script.ScriptPath
   MenuItem.Hint = "Album"


   Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_TrackList_MoreFrom, -1, -1)
   MenuItem.Caption = SDB.Localize("Artist") + " [allmusic.com]"
   MenuItem.IconIndex = 37
   MenuItem.OnClickFunc = "allmusic"
   MenuItem.UseScript = Script.ScriptPath
   MenuItem.Hint = "Artist"
   
   Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_NP_MoreFrom, -1, -1)
   MenuItem.Caption = SDB.Localize("Artist") + " [allmusic.com]"
   MenuItem.IconIndex = 37
   MenuItem.OnClickFunc = "allmusic"
   MenuItem.UseScript = Script.ScriptPath
   MenuItem.Hint = "Artist"


   Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_TrackList_MoreFrom, -1, -1)
   MenuItem.Caption = SDB.Localize("Artist") + " [Wikipedia.org]"
   MenuItem.IconIndex = 37
   MenuItem.OnClickFunc = "allmusic"
   MenuItem.UseScript = Script.ScriptPath
   MenuItem.Hint = "ArtistWikipedia"
   
   Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_NP_MoreFrom, -1, -1)
   MenuItem.Caption = SDB.Localize("Artist") + " [Wikipedia.org]"
   MenuItem.IconIndex = 37
   MenuItem.OnClickFunc = "allmusic"
   MenuItem.UseScript = Script.ScriptPath
   MenuItem.Hint = "ArtistWikipedia"


   Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_TrackList_MoreFrom, -1, -1)
   MenuItem.Caption = SDB.Localize("Artist") + " [Last.fm]"
   MenuItem.IconIndex = 37
   MenuItem.OnClickFunc = "allmusic"
   MenuItem.UseScript = Script.ScriptPath
   MenuItem.Hint = "ArtistFM"
   
   Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Pop_NP_MoreFrom, -1, -1)
   MenuItem.Caption = SDB.Localize("Artist") + " [Last.fm]"
   MenuItem.IconIndex = 37
   MenuItem.OnClickFunc = "allmusic"
   MenuItem.UseScript = Script.ScriptPath
   MenuItem.Hint = "ArtistFM"
   
 
   Set MenuItem = Nothing
End Sub

Sub allmusic(MenuItem)
   if SDB.SelectedSongList.Count > 0 then
      Dim Song
      Set Song = SDB.SelectedSongList.Item(0)
      Dim Artist
      Dim Album
   
      Artist = Replace(Song.ArtistName, " ", "+")
      Artist = Replace(Artist,"&","%")
      Album = Replace(Song.AlbumName, " ", "+")
      Album = Replace(Album,"&","%")
       
      Dim WshShell
      Set WshShell = CreateObject("WScript.Shell")
      if MenuItem.Hint = "Artist" then
         WshShell.Run("http://www.allmusic.com/cg/amg.dll?P=amg&uid=SEARCH&opt1=1&sql=" + Artist)
      end if 

      if MenuItem.Hint = "ArtistWikipedia" then
         WshShell.Run("http://en.wikipedia.org/wiki/Special:Search?search=" + Artist + "&go=Go")
      end if 
      if MenuItem.Hint = "ArtistFM" then
        WshShell.Run("http://www.last.fm/explore/search.php?q=" + Artist + "&m=artists")
      end if 

      if MenuItem.Hint = "Album" then
         WshShell.Run("http://www.allmusic.com/cg/amg.dll?P=amg&uid=SEARCH&opt1=2&sql=" + Album)
      end if 
    
      Set WshShell = Nothing
   end if
end Sub

Posted: Wed Mar 15, 2006 11:24 am
by urlwolf
Now that you seem to communicate with Allmusic all right, how difficult would it be to get the album art and other info from them as well?

Posted: Wed Mar 15, 2006 11:28 am
by judas
this has been requested (me included) many times, but they dont provide an apy and i think is against their licence or something like that...besides that, the script doesnt actually communicates with allmusic...it just sends the search query to a browser.

i dont think this is coming in the near future...some players that USED to allow this sort of thing stopped working since allmusic changed...


judas

Posted: Wed Mar 22, 2006 8:17 pm
by Steegy
how difficult would it be to get the album art and other info from them as well
For people who don't know yet:
A solution exists to tag your files from web resources, using "Web Sources Tagger": http://www.mediamonkey.com/forum/viewto ... 1069#41069
For more information (history, possibilities), please take a look in that thread.

It currently works for Amazon (all sites), All Music Guide (AMG), FreeDB, Discogs, Walmart (covers) and DarkTown (covers).
Other scripts already exist but have to be improved (e.g. iTunes (covers), ArtistDirect and MusicBrainz.)

If you want other sites to be supported, please let us know. Or take a look at the above linked forum page to find information on how to create/edit sources scripts yourself (documentation from Mp3Tag).

Cheers
Steegy

Google search vbs proble

Posted: Sat Apr 29, 2006 7:26 am
by jatsad
I have tried to run the google search script, as well as the wikipedia,lastfm and allmusic.
In all cases I get the following error.

Error#-2147023241
File "E:\Program Files\MediaMonkey\Scripts\Auto\Google.vbs" Line: 50, Column: 9

When you press the OK button, the following is displayed.

Error happened during script execution:
No application is associated with the specified file for this operation.

The code with associated line numbers is:

37 Sub Google(MenuItem)
38 if SDB.SelectedSongL ist.Count > 0 then
39 Dim Song
40 Set Song = SDB.Se lectedSongList.Item(0)
41 Dim Artist
42 Dim Album
43
44 Artist = "%22" + Replace(Song.ArtistName, " ", "%20") + "%22"
45 Album = "%22" + R eplace(Song.AlbumName, " ", "%20") + "%22"
46
47 Dim WshShell
48 Set WshShell = Cr eateObject("WScript.Shell")
49 if MenuItem.Hint = "Artist" then
50 WshShell.Run(" www.google.com/search?q=" + Artist + "")
51 else
52 WshShell.Run(" www.google.com/search?q=" + Artist + "+" + Album)
53 end if
54 Set WshShell = No thing
55 end if
56 end Sub


Your help is appreciated in advance.