[MM2+3] Search Google, Wikipedia, Last.fm, ...

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

[MM2+3] Search Google, Wikipedia, Last.fm, ...

Postby onkel_enno » Mon Jan 30, 2006 2:32 am

As a Wish of Mhesse, here is a small script which creates 2 Entries in the Find more From - Menu-Item to Search google for "the Artist" or "the Artist and the Album".
Maybe someone else needs it too.
BTW: The URL google.de can easily be changed :wink:

- Create a file Google.vbs in Scripts\Auto and paste the code into it.
- Start MM.
- Enjoy!

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") + " (google.de)"
   MenuItem.IconIndex = 37
   MenuItem.OnClickFunc = "Google"
   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") + " (google.de)"
   MenuItem.IconIndex = 37
   MenuItem.OnClickFunc = "Google"
   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") + " (google.de)"
   MenuItem.IconIndex = 37
   MenuItem.OnClickFunc = "Google"
   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") + " (google.de)"
   MenuItem.IconIndex = 37
   MenuItem.OnClickFunc = "Google"
   MenuItem.UseScript = Script.ScriptPath
   MenuItem.Hint = "Album"
   
   Set MenuItem = Nothing
End Sub

Sub Google(MenuItem)
   if SDB.SelectedSongList.Count > 0 then
      Dim Song
      Set Song = SDB.SelectedSongList.Item(0)
      Dim Artist
      Dim Album
   
      Artist = "%22" + Replace(Song.ArtistName, " ", "%20") + "%22"
      Artist = Replace(Artist, "&", "%26")
      Album = "%22" + Replace(Song.AlbumName, " ", "%20") + "%22"
      Album = Replace(Album, "&", "%26")
      
      Dim WshShell
      Set WshShell = CreateObject("WScript.Shell")
      if MenuItem.Hint = "Artist" then
         WshShell.Run("www.google.de/search?q=" + Artist + "")
      else
         WshShell.Run("www.google.de/search?q=" + Artist + "+" + Album)
      end if
      Set WshShell = Nothing
   end if
end Sub
Last edited by onkel_enno on Wed Sep 12, 2007 5:16 am, edited 3 times in total.
SansaMonkey - for SanDisk Sansa and Rockbox Users

Please no PMs for Questions which should be asked in the Forum. Thx
onkel_enno
 
Posts: 2139
Joined: Fri Jan 14, 2005 1:45 am
Location: Germany

Postby trixmoto » Mon Jan 30, 2006 5:01 am

Useful script, I like it! :)
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Postby Sammy20 » Mon Jan 30, 2006 6:23 am

Nice!

Request: Could you make a script so it searches http://www.allmusic.com/ for the artist profile.

Wait, not to sound too greedy, but it would be cool if it had 3 options in a sub-menu to display search results for:

Wikipedia
AMG All music
last.fm

This would be very handy.
Sammy20
 
Posts: 110
Joined: Thu Feb 17, 2005 5:42 am

Postby onkel_enno » Mon Jan 30, 2006 6:51 am

Thx you both. 8)

I'm not sure about these 3. I can't find something about URL I can put the Serach Criterias in :-?
Maybe someone else has an idea. Trix?
SansaMonkey - for SanDisk Sansa and Rockbox Users

Please no PMs for Questions which should be asked in the Forum. Thx
onkel_enno
 
Posts: 2139
Joined: Fri Jan 14, 2005 1:45 am
Location: Germany

Postby Sammy20 » Mon Jan 30, 2006 7:01 am

I know of a script that has the search code for those 3 sites. I'll go fetch it now.....
Sammy20
 
Posts: 110
Joined: Thu Feb 17, 2005 5:42 am

Postby Lowlander » Mon Jan 30, 2006 7:05 am

Wikipedia:
http://en.wikipedia.org/wiki/Artist

lastfm:
http://www.last.fm/explore/explore.php?artistname=Artist for search and http://www.last.fm/music/Artist for artist page.

allmusic
works with a dll and encrypted url so a no go it seems.
Lowlander
 
Posts: 31656
Joined: Sat Sep 06, 2003 5:53 pm

Postby trixmoto » Mon Jan 30, 2006 7:08 am

:) Wikipedia: Use the link
Code: Select all
WshShell.Run("http://en.wikipedia.org/wiki/Special:Search?search=" + Artist + "&go=Go")

:( Allmusic: Doesn't use open search links, not sure how you'd do that.

:) Last.fm: Use this link
Code: Select all
WshShell.Run("http://www.last.fm/explore/search.php?q=" + Artist + "&m=artists")
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Postby trixmoto » Mon Jan 30, 2006 7:14 am

Looks like Lowlander has beaten me to it! :oops:

Although, I'd recommend using the Wikipedia (and Last.fm) search links rather than the direct links, as you get more useful pages if your match does not exist.
Check out my scripts at trixmoto.net and subscribe to my RSS feed for updates.
Also check out my Uniface blog.
Get a free Dropbox account! :o

Image
trixmoto
 
Posts: 9703
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK

Postby Lowlander » Mon Jan 30, 2006 7:35 am

Figured allmusic out I think:
http://www.allmusic.com/cg/amg.dll?P=amg&OPT1=1&SQL=artist
Lowlander
 
Posts: 31656
Joined: Sat Sep 06, 2003 5:53 pm

Postby Sammy20 » Mon Jan 30, 2006 7:47 am

Great, thanks guys.
Sammy20
 
Posts: 110
Joined: Thu Feb 17, 2005 5:42 am

Postby onkel_enno » Mon Jan 30, 2006 7:52 am

Nice work guys :lol:
SansaMonkey - for SanDisk Sansa and Rockbox Users

Please no PMs for Questions which should be asked in the Forum. Thx
onkel_enno
 
Posts: 2139
Joined: Fri Jan 14, 2005 1:45 am
Location: Germany

Postby Sammy20 » Mon Jan 30, 2006 8:04 am

Well I suck.

I just tried making a script for all those sites. It added in MM successfully, but when I click on it I get a 'unknown name' error message. Here's the code


Code: Select all
 removed by request



Can someone make them for me.
Last edited by Sammy20 on Mon Jan 30, 2006 7:22 pm, edited 1 time in total.
Sammy20
 
Posts: 110
Joined: Thu Feb 17, 2005 5:42 am

Postby onkel_enno » Mon Jan 30, 2006 8:12 am

Your OnClickFunc-Method points to Wikipedia, but there is no Wikipedia-Procedure. Rename Sub Google(Menuitem) to Sub Wikipedia(Menuitem).
SansaMonkey - for SanDisk Sansa and Rockbox Users

Please no PMs for Questions which should be asked in the Forum. Thx
onkel_enno
 
Posts: 2139
Joined: Fri Jan 14, 2005 1:45 am
Location: Germany

Postby Sammy20 » Mon Jan 30, 2006 8:44 am

That fixed it. Thank you 8)


Could someone help me with allmusic. I tried your code lowlander and got this result:

http://www.allmusic.com/cg/amg.dll?P=am ... s%22&go=Go

Here's my code:

Code: Select all
 Removed by request
Last edited by Sammy20 on Mon Jan 30, 2006 7:21 pm, edited 1 time in total.
Sammy20
 
Posts: 110
Joined: Thu Feb 17, 2005 5:42 am

Postby Lowlander » Mon Jan 30, 2006 8:49 am

For allmusic you would need to do this I think:

Code: Select all
Artist = Replace(Song.ArtistName, " ", "")


You also don't need this in the url
Code: Select all
&go=Go
Lowlander
 
Posts: 31656
Joined: Sat Sep 06, 2003 5:53 pm

Next

Return to Need Help with Addons?

Who is online

Users browsing this forum: Google [Bot] and 16 guests