Mrz 8 2007

WebSearch Panels for MediaMonkey

7 Kommentare 

The following script adds as many panels as defined to the MediaMonkey screen. Eeach of these panels performs a specific web search on Artist, Title of Album.The script needs a XML file as a configuration file.

Screenshots

Installation

Using the Installer

You can download and use this installation program Note: If you already have a site configuration file, this file won’t get overwritten!

Manual installation

Installing script

Copy this script code, paste it to an empty text file and save it to “%MM_DIR%/Scripts/Auto/WebSearch.vbs”.

Setting up the configuration file

The configuration file needs to be named WebSearch.xml and must be located in the same directory as the script.

For each site, you need a entry in this file with the following parameters:

parameter description example
name a unique name for the site. This is used internally only, but must really be unique… <name> GoogleMusic </name>
caption The caption of the panel <caption> Google Music </caption>
description The desription is shown in the “Search” menu bar <description> Search current Artist in Google Music </description>
start the start page that is shown when no title is played <start> http://www.google.com/musicsearch?q= </start>
url The “url” parameter is the Web Search URL, and the placeholders %artist%, %title% asd %album% are replaced accordingly. <url> http://www.google.com/musicsearch?q=%artist%&res=artist </url>

As an example, see this file. You can use it as a starting point. Copy the xml code to an empy text file. Throw away the entries you don’t want or don’t need. Add new sites if you want.

Using the script

Start (or re-start) MediaMonkey. For each <site> entry you put in xml file, one panel will be opened. You can close those you don’t want to be open at the moment. To re-open a panel, in the Search Toolbar click on the “Search The Web” button and choose desired site.

Saving Lyrics and Comments

Let’s suppose you want to save the lyrics fetched from lyrics-songs.com site to ID3 tag. Just play a song a wait for the panel to show the lyrics. Select the lyrics text and press “Lyrics” button. Done! No CTRL+C is needed in this case. Same procedure to save a text to Comment field.
If, for some reason, the text you want to paste is outside the panel (a text file, for example) do the following: DO NOT select any text inside the panel itself, just open the file, select the text and copy it (now CTRL+C is needed). Come back to MediaMonkey and press the “Lyrics” or “Comment” button. Done! Your text is saved in corresponding field.

Working with local html files

This method works with local files as well. As a POC use the following HTML file, save it somewhere and make an entry to WebSearch.xml for the file like

  <site>
    <name>SongInfo</name>
    SongInfo
    <description>Displays Information on the current song</description>
    <start>about:blank</start>
    <url>file:///C:/Programs/MediaMonkey/Scripts/Song.htm</url>
  </site>

The corresponding HTML file:


    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

<title>&lt;br /&gt;      Song details&lt;br /&gt;    </title>
    <style type="text/css">
/*< ![CDATA[*/
body {
  background-color: White;
  font-family: Verdana;
  font-size: 8pt;
  margin: 0.1em;
}
/*]]>*/
    </style>

    <script type="text/vbscript" language="VBScript">
'< ![CDATA[
Option Explicit

Sub Window_OnLoad
    Dim SDB
    Dim item

    'Connect to MM
    Set SDB = CreateObject("SongsDB.SDBApplication")
    Set item = SDB.Player.CurrentSong

    document.getElementById("artist").InnerHTML =  item.ArtistName
    document.getElementById("title").InnerHTML =  item.Title
    document.getElementById("album").InnerHTML =  item.AlbumName

    Set SDB = Nothing
    Set item = Nothing
End Sub
//]]>
    </script>

    Artist: 

    Title: 

    Album: 

Known errors

Error #424 – Microsoft VBScript runtime error

You’ll get this error without a valid configuration file in place

Support

Support is given at the MediaMonkey support forum.

Folgende Beiträge könnten für Sie ebenfalls von Interesse sein:

Kommentare

7 Kommentare to “WebSearch Panels for MediaMonkey”

  1. BrettNo Gravatar on März 28th, 2008 12:14

    Jörgs, I just installed Web Search Panels and just can’t believe how good this is. Fantastic thank you for all your hard work. I have only one problem that I can’t figure out and that is getting the lyrics from website to fix to the tags. You mention a Lyric’s BUTTON? Am I just stupid (LOL) I can copy simply by copying and pasting to the tags but if there is an automated way of doing this …. well easy is always better. But for the life of me I can’t find a Lyrics Buttom anywhere on MM3!
    If you have the time and can help me I would be very appreciative.
    Great work mate
    Cheers from Oz
    Brett

  2. JörgNo Gravatar on April 6th, 2008 15:31

    Brett,

    you should have two buttons, one named “Lyrics” and the other one “Comments” (as seen on th escreenshots). Clicing one of them will copy the marked text into the respective field.

    Jörg

  3. JamesNo Gravatar on Mai 29th, 2008 17:04

    This is an awesome script, but it is sadly out of date. Is there any chance that you will update this to v0.3 of the Lyrics Plugin?

  4. Fanny ANo Gravatar on September 4th, 2008 17:48

    Really nice script !
    As James said, an update for the v0.3 of Lyrics plugin would be really great, as this latest version allow to configure the size (and color) of the lyrics pages.
    Thanks for your work !
    JaneAir (Fanny ;) )

  5. Bruno OzNo Gravatar on Dezember 12th, 2008 00:51

    Really good script. Thanks for it!

  6. O BNo Gravatar on Mai 28th, 2009 14:26

    Hi,
    i’ve have modified your code so it’s not performing a search if the panels are not open. I had some problems because of the huge list of panels I have created so it was hanging for a few sec between each track.
    I’m not sure it’s the best way (i’m not a programmer) but it seems to work.

    Line 592

    if Panels(Key).Visible Then
    Panels(Key).GoSearch
    end if

  7. MaxNo Gravatar on März 2nd, 2010 22:34

    Jörgs,

    Using WebSearch for lyrics is fantastic! Coolest things since sliced bread!

    Max

Kommentar abgeben