A script to modify the Web-feature in MediaMonkey; Need help

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: A script to modify the Web-feature in MediaMonkey; Need help

by onenonymous » Sun Mar 09, 2008 12:02 pm

Also check out my Right Click For Web script:
http://www.mediamonkey.com/forum/viewtopic.php?t=26875

by fridge » Mon Feb 04, 2008 2:34 am

Just letting you know I've tried to script what you suggested ;) ... it can be found here

by trixmoto » Sat Jan 26, 2008 5:07 am

Well you just need to create your parent node under "Web", and then add your other nodes to this instead of to the "Web" node. Something like this...

Code: Select all

Sub OnStartup
  Dim Tree : Set Tree = SDB.MainTree
  Dim Node : Set Node = Tree.CreateNode
  Node.Caption = "YouTube"
  Node.IconIndex = 55
  Script.RegisterEvent Node, "OnNodeFocused", "NodeFocus"
  Tree.AddNode Tree.Node_Web, Node, 1
  Node.HasChildren = True

  Dim Sub1 : Set Sub1 = Tree.CreateNode
  Sub1.Caption = "Artist"
  Sub1.IconIndex = 55
  Script.RegisterEvent Sub1, "OnNodeFocused", "Sub1Focus"
  Tree.AddNode Node, Sub1, 1
  Sub1.HasChildren = False

  Dim Sub2 : Set Sub2 = Tree.CreateNode
  Sub2.Caption = "Title"
  Sub2.IconIndex = 55
  Script.RegisterEvent Sub2, "OnNodeFocused", "Sub2Focus"
  Tree.AddNode Node, Sub2, 1
  Sub2.HasChildren = False
End Sub

by justin_f » Sat Jan 26, 2008 1:11 am

How would I go about adding a subnode to one of these nodes? For example, I created two for youtube; one searches by the Artist, the other searches by the Title. How would I put this under a single parent node?

by Guest » Thu Jan 10, 2008 12:25 pm

If mod of WebSearchPanel, conversion or new script, I'd love it! because I don't like WebSearchPanel displaying content in a new pane/window! Mike

by RedX » Thu Jan 10, 2008 6:22 am

drjboulder wrote:I am really liking this.
Seems like it could actually replace WebSearchPanels.

I have been trying to replicate the searches for which I use WebSearchPanels.
My success so far has not been very good.
I think it would be easier to create a mod of websearchepanel to create the nodes then to adapt each and every xml. But i have never used websearchpanel so no guarantee that it's possiple!

Write the creator in the WSP thread to know what he thinks of it.

Regards,
Red

by drjboulder » Thu Jan 10, 2008 3:05 am

I am really liking this.
Seems like it could actually replace WebSearchPanels.

I have been trying to replicate the searches for which I use WebSearchPanels.
My success so far has not been very good.

I have read past posts regarding web nodes and perused the scripting wiki.
Only to decide that I am more than dense when it comes to VBS.

So, if anyone would care to help me out here is the XML for WSP that I have not been able to replicate:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <site>
    <name>Google</name>
    <caption>Google</caption>
    <description>Search Google for Artist</description>
    <start>http://www.google.com</start>
    <url>http://www.google.com/search?q=%artist%</url>
  </site>
  
  <site>
    <name>GoogleMusic</name>
    <caption>Google Music</caption>
    <description>Search current Artist in Google Music</description>
    <start>http://www.google.com/musicsearch?q=</start>
    <url>http://www.google.com/musicsearch?q=%artist%&res=artist</url>
  </site>

  <site>
    <name>GoogleImages</name>
    <caption>Google Images</caption>
    <description>Search Google for Images</description>
    <start>http://images.google.com</start>
    <url>http://images.google.com/images?q="%albumartist%"+"%album%"</url>
  </site>
    
  <site>
      <name>musicbrainz</name>
      <caption>MusicBrainz</caption>
      <description>Search MusicBrainz</description>
      <start>http://musicbrainz.org/</start>
      <url>http://musicbrainz.org/search/textsearch.html?type=track&query="%artist%"+"%title%"</url>
  </site>
  

  <site>
      <name>allmusic_alb</name>
      <caption>allmusic.com:Album</caption>
      <description>allmusic</description>
      <start>http://www.allmusic.com/</start>
      <url>http://www.allmusic.com/cg/amg.dll?p=amg&sql=2:%album%</url>
   </site>
   
   <site>
       <name>Youtube_Music</name>
       <caption>Youtube Music</caption>
       <description>Search current Artist in Youtube Music</description>
       <start>http://www.youtube.com</start>
       <url>http://www.youtube.com/results?search_query=%artist%+%title%&search_category=10</url>
     </site>
     
     <site>
         <name>slothradio_cd_coversearch</name>
         <caption>slothradio_cd_coversearch</caption>
         <description>Search sloth radio for covers</description>
         <start>http://www.slothradio.com/covers/</start>
         <url>http://www.slothradio.com/covers/?&artist="%artist%"&album="%album%"</url>
  </site>
  
  <site>
      <name>AllCdCovers</name>
      <caption>All Cd CoverArt</caption>
      <description>Cover Search</description>
      <start>http://www.allcdcovers.com</start>
      <url> http://www.allcdcovers.com/search/%artist%+%album%</url>
  </site>
  
  <site>
        <name>LyricWiki</name>
        <caption>LyricWiki</caption>
        <description>LyricsWiki Search</description>
        <start>http://lyricwiki.org</start>
        <url>http://lyricwiki.org/api.php?artist=%artist%&song=%title%&fmt=html</url>
  </site>
    
  <site>
    <name>lyricssongs</name>
    <caption>lyrics-songs.com</caption>
    <description>Search current title's lyrics in lyrics-songs.com</description>
    <start>http://www.lyrics-songs.com/</start>
    <url>http://www.lyrics-songs.com/winamp.php?musica=%title%&artista=%artist%</url>
  </site>   

  <site>
    <name>lyricsplugin</name>
    <caption>lyricsplugin.com</caption>
    <description>Search current title's lyrics in lyricsplugin.com</description>
    <start>http://www.lyricsplugin.com/</start>
    <url>http://www.lyricsplugin.com/plugin/?title=%title%&artist=%artist%</url>
  </site>   
  
</configuration>

Top priority would be the "Sloth Radio" one and the lyrics sites.

Also, I was wondering if this can all be in one script. The ones I got to work are little "scriplets". Would rather not have a dozen or so of these.

I know that I am asking a lot, any partial help will be greatly appreciated!
Even a schooling of acceptable parameters that can follow

Code: Select all

+ SDB.player
would be helpful.
Complete help would earn complete admiration and respect!

by trixmoto » Wed Jan 09, 2008 5:46 am

I don't think this is currently available via scripting, but then the scripting changes for MM3 are mostly undocumented at the moment so it might be possible now or in the future.

by The Crow » Tue Jan 08, 2008 6:20 pm

Just getting fun to create such nodes as well... :)

I noticed that if such a node is clicked the search setting automatically changes to "current selection", in contrast to all other nodes. Would it be possible to keep (automatically) "entire library" or can I modify the search generally so that it always looks up in the entire library?

by trixmoto » Tue Jan 08, 2008 1:05 pm

I'm glad we could help. :)

by MonkeyBone » Tue Jan 08, 2008 11:56 am

Oh, man..


You guys are my heroes!!


Thanks!! It worked!! :D

by m_bojangles » Tue Jan 08, 2008 11:13 am

I don't have access to test this right now, but what if you tried this:

Code: Select all

Function NodeFocus(Node)
  ' This should work as long as the artist name does not have % or + in it's name.
Call SDB.WebControl.Navigate("http://en.wikipedia.org/wiki/" + SDB.player.currentsong.artist.name )
  NodeFocus = 2
End Function

by MonkeyBone » Tue Jan 08, 2008 11:07 am

Just one more thing..

Sorry for the trouble, guys.. but I've started to get real excited here now.. :oops:


I've made another node with the functions of Wikipedia.. just changed something from the last.fm -node..

Code: Select all

Function NodeFocus(Node)
  ' This should work as long as the artist name does not have % or + in it's name.
Call SDB.WebControl.Navigate("http://en.wikipedia.org/wiki/" + replace(SDB.player.currentsong.artist.name," ","+") )
  NodeFocus = 2
End Function
Anyway.. It works fine when the Artist is just ONE word, but when the artist name is separated by one or more spaces, the wikipedia reacts to the + -sign.. Artists like "Black Sabbath", "Tom Jones", "Guano Apes", etc..


Could you help me with this as well?


Really sorry for my lack of knowledge and for my eagerness, but this is just so great I can't help myself.. :oops:



Thanks!!

by MonkeyBone » Tue Jan 08, 2008 10:30 am

Ooh..

This is just TOO good!!


Thank you VERY MUCH, guys!! :D :D

by RedX » Tue Jan 08, 2008 10:07 am

MonkeyBone wrote:Thank you! :D


This is REALLY!! starting to look like something!!

All i need now is to make it go to the %Arist% being played when I press the link, instead of the constant link; http://www.last.fm

I've tried http://www.last.fm/music/%Artist%, but I couldn't get that to work..
Try

Code: Select all

Function NodeFocus(Node)
  ' This should work as long as the artist name does not have % or + in it's name.
Call SDB.WebControl.Navigate("http://www.last.fm/music/" + replace(SDB.player.currentsong.artist.name," ","+") )
  NodeFocus = 2
End Function
This should work as long as the artist name does not have % or + in it's name.
For correct encoding use the fixurl function that is used in some scripts and has been coded by trix.

Regards,
Red

Top