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

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

MonkeyBone
Posts: 66
Joined: Sun Nov 19, 2006 9:39 am

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

Post by MonkeyBone » Mon Jan 07, 2008 4:48 am

Hello! :)


I really want to make use of the web-function..

Image


I want it to support last.fm, and wikipedia.org and others, but these two as number 1 priority!

I would also like the ability to remove the amazon.com, and AllMusic and the others, and replace/add the two sites (+) I've listed above..

And I want it to support Firefox (with installed plugin's)

So my goal is; I want the function to work just like webseach-panel functions.. So, when I go to the last.fm page in the web-tree, I want to come to the page on last.fm which displays information about the artist that's being played atm.. Just like the websearch-panel -scripts!


Hope you understand what I mean.. and, pardon my English!


So, if any of you want to make this thing, I would be very happy! And I would happily donate when it's complete! :)

But, I would also appreciate if you could help me on my way to make it myself; show me the directions.. (Because I REALLY want this thing to come true!!)

I have never coded scripts before (actually, I've never coded that much in general, but I've have some tiny-tiny-tiny knowledge of some C++ and Turbo Assembly).

So, if you could link some pages to where I can get some knowledge of script-making for MM, that would be great! More precisely how to edit the web-function..


Thank you very much! :)
[AMD Athlon 64 FX-60] . [Hiper Type-R 580W] . [Western Digital Raptor X] . [Lian Li PC777B]
[Hightech Excalibur Radeon x1900xtx 512 MB] . [OCZ EB DDR PC-4000 2 GB Pl.Ed. Dual Channel]
[DFI Lanparty UT RDX200 CF-DR] . [Creative SB X-Fi Fatal1ty FPS] . [DELL UltrasSharp 2405 FPW 24"]
3DMark05 : 11043 . 3DMark06 : 5856 . (a non-clocked system) . AudioScrobbler . Xfire . YMDb

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Post by trixmoto » Mon Jan 07, 2008 5:41 am

Well this is probably possible, but not using Firefox, only IE.

Firstly you need to add the node...

Code: Select all

Sub OnStartup
  Dim Tree : Set Tree = SDB.MainTree
  Dim Node : Set Node = Tree.CreateNode
  Node.Caption = "Last.Fm"
  Node.IconIndex = 55
  Script.RegisterEvent Node, "OnNodeFocused", "NodeFocus"
  Tree.AddNode Tree.Node_Web, Node, 1
  Node.HasChildren = False
End Sub
Then you need to define what to do when the node is clicked on...

Code: Select all

Function NodeFocus(Node)
  Call SDB.WebControl.Navigate("http://www.last.fm")
  NodeFocus = 2
End Function
That should be enough to get you started! :)
Last edited by trixmoto on Mon Jan 07, 2008 10:42 am, edited 2 times in total.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Post by trixmoto » Mon Jan 07, 2008 5:42 am

Sorry, I assumed you wanted it to open the webpage within MM - did you mean you wanted it to open the page on your browser externally?
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

Guest

Post by Guest » Mon Jan 07, 2008 10:06 am

MonkeyBone here;

I've not tried it yet, but yes, I wanted it to open within the MM, and not in an external browser..

Thank you! I will look into it a little later!


Thanks!! :)

MonkeyBone
Posts: 66
Joined: Sun Nov 19, 2006 9:39 am

Post by MonkeyBone » Mon Jan 07, 2008 11:00 am

hmm.. How do I add a / the node?

:oops:
[AMD Athlon 64 FX-60] . [Hiper Type-R 580W] . [Western Digital Raptor X] . [Lian Li PC777B]
[Hightech Excalibur Radeon x1900xtx 512 MB] . [OCZ EB DDR PC-4000 2 GB Pl.Ed. Dual Channel]
[DFI Lanparty UT RDX200 CF-DR] . [Creative SB X-Fi Fatal1ty FPS] . [DELL UltrasSharp 2405 FPW 24"]
3DMark05 : 11043 . 3DMark06 : 5856 . (a non-clocked system) . AudioScrobbler . Xfire . YMDb

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Post by trixmoto » Tue Jan 08, 2008 4:21 am

Sorry, all the code I gave you needs to go into a .vbs file in the "Scripts\Auto\" folder, then when you startup MM the node should be there.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

MonkeyBone
Posts: 66
Joined: Sun Nov 19, 2006 9:39 am

Post by MonkeyBone » Tue Jan 08, 2008 6:43 am

Thank you! :D


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

It's (almost) just what I'm looking for!

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.. I've also tried some other twists, but no luck there either..


Could you help me with this as well?


Thank you SO!! much!! :D
[AMD Athlon 64 FX-60] . [Hiper Type-R 580W] . [Western Digital Raptor X] . [Lian Li PC777B]
[Hightech Excalibur Radeon x1900xtx 512 MB] . [OCZ EB DDR PC-4000 2 GB Pl.Ed. Dual Channel]
[DFI Lanparty UT RDX200 CF-DR] . [Creative SB X-Fi Fatal1ty FPS] . [DELL UltrasSharp 2405 FPW 24"]
3DMark05 : 11043 . 3DMark06 : 5856 . (a non-clocked system) . AudioScrobbler . Xfire . YMDb

RedX
Posts: 366
Joined: Wed Dec 27, 2006 10:32 am
Location: Germany

Post 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

MonkeyBone
Posts: 66
Joined: Sun Nov 19, 2006 9:39 am

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

Ooh..

This is just TOO good!!


Thank you VERY MUCH, guys!! :D :D
[AMD Athlon 64 FX-60] . [Hiper Type-R 580W] . [Western Digital Raptor X] . [Lian Li PC777B]
[Hightech Excalibur Radeon x1900xtx 512 MB] . [OCZ EB DDR PC-4000 2 GB Pl.Ed. Dual Channel]
[DFI Lanparty UT RDX200 CF-DR] . [Creative SB X-Fi Fatal1ty FPS] . [DELL UltrasSharp 2405 FPW 24"]
3DMark05 : 11043 . 3DMark06 : 5856 . (a non-clocked system) . AudioScrobbler . Xfire . YMDb

MonkeyBone
Posts: 66
Joined: Sun Nov 19, 2006 9:39 am

Post 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!!
[AMD Athlon 64 FX-60] . [Hiper Type-R 580W] . [Western Digital Raptor X] . [Lian Li PC777B]
[Hightech Excalibur Radeon x1900xtx 512 MB] . [OCZ EB DDR PC-4000 2 GB Pl.Ed. Dual Channel]
[DFI Lanparty UT RDX200 CF-DR] . [Creative SB X-Fi Fatal1ty FPS] . [DELL UltrasSharp 2405 FPW 24"]
3DMark05 : 11043 . 3DMark06 : 5856 . (a non-clocked system) . AudioScrobbler . Xfire . YMDb

m_bojangles
Posts: 98
Joined: Fri Jun 11, 2004 8:22 pm

Post 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

MonkeyBone
Posts: 66
Joined: Sun Nov 19, 2006 9:39 am

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

Oh, man..


You guys are my heroes!!


Thanks!! It worked!! :D
[AMD Athlon 64 FX-60] . [Hiper Type-R 580W] . [Western Digital Raptor X] . [Lian Li PC777B]
[Hightech Excalibur Radeon x1900xtx 512 MB] . [OCZ EB DDR PC-4000 2 GB Pl.Ed. Dual Channel]
[DFI Lanparty UT RDX200 CF-DR] . [Creative SB X-Fi Fatal1ty FPS] . [DELL UltrasSharp 2405 FPW 24"]
3DMark05 : 11043 . 3DMark06 : 5856 . (a non-clocked system) . AudioScrobbler . Xfire . YMDb

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

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

I'm glad we could help. :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

The Crow
Posts: 44
Joined: Wed Nov 28, 2007 4:05 pm

Post 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?

trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Barton, UK
Contact:

Post 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.
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Send me BTC: 34VQPVsf9mCeR4nfhFvvBYZqQ7LkqNZ8Mn
Send me LTC: 3P1mzrfbyscdhbxRpXLgKz7tufGAU3SrEG
Send me DOGE: 9xPpYSqgF7P5yQiqvE1VqWb4UjxVCCLFJ6
Check out these great cryptocurrency faucets... BTC / LTC / DOGE

Post Reply