WebSearch Panels (updated March 14, 2007) now with installer

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

jn
Posts: 61
Joined: Mon Jul 24, 2006 2:50 pm
Location: Germany

WebSearch Panels at Google code

Post by jn »

I set up a project at Google code which holds the current code in SVN and provides downloads of the installer as well. I updated the links in the first post.

http://code.google.com/p/mm-scripts/
gege
Posts: 866
Joined: Tue Sep 05, 2006 2:10 pm
Location: Brazil

Post by gege »

Hey, welcome back!
jn
Posts: 61
Joined: Mon Jul 24, 2006 2:50 pm
Location: Germany

Post by jn »

gege wrote:Hey, welcome back!
:D
Baculaat
Posts: 14
Joined: Tue Aug 14, 2007 6:06 am

Post by Baculaat »

HELLO PEOPLE,

looking for a Metacritic script (automatically going to the album review)
looking for a Pitchfork script (automatically going to the album review)

and i would like to see album art automatically saving itself for the first jpg file that's found. now copying the picture that my website found and pasting it into the 'properties/album art' tab.

any help is appreciated!

bert
das Monkey
Posts: 70
Joined: Tue Feb 12, 2008 7:11 pm

Post by das Monkey »

I have a lot of tracks with additional info attached in parentheses or brackets ("live", "alternate cut", "featuring so-and-so", etc.). This extra info keeps the searches from finding good results.

So I made a very primitive modification to this script that is working well for me so far. It essentially trims the title of a track when searching at the first parenthesis or bracket it finds after the first character (don't want to pick up those songs where the first part of the title is in parentheses). I also added special cases to ignore "part" and "vol" -- "Another Brick in the Wall (Part 2)" got erroneously trimmed :).

Anyway, it's primitive and could probably be accomplished in 15 better ways, but it only took 5 minutes, and it works, so I'm leaving it. All I did was modify this function. Sharing for anyone who may care:

Code: Select all

    Function ReplaceTokens(ByVal URL, ByVal Song)
        With Song
        		Dim t
        		t = .Title

        		Dim p
        		p = InStr(1, t, " (")
        		If p > 0 Then
        			If InStr(1, t, " (Part") = 0 And InStr(1, t, "(Vol") = 0 Then
        				t = Mid(t, 1, p - 1)
        			End If
        		End If
        		p = InStr(1, t, " [")
        		If p > 0 Then
        			t = Mid(t, 1, p - 1)
        		End If
        		
            URL = Replace(URL, "%artist%",       .ArtistName)
            URL = Replace(URL, "%title%",        t)
            URL = Replace(URL, "%album%",        .AlbumName)
            URL = Replace(URL, "%albumartist%",  .AlbumArtistName)
        End With
        ReplaceTokens = URL
    End Function
I've considered trimming the .ArtistName field at the first comma too. I have a lot of tracks performed by multiple artists and can't think of a single one where the comma is part of an established band name. Consequently, I never get any results on the searches. I'd probably rather find the first artist than no one at all.

das
jn
Posts: 61
Joined: Mon Jul 24, 2006 2:50 pm
Location: Germany

Post by jn »

Very good idea, I modified the version in SVN.
Thank you!

Jörg
das Monkey
Posts: 70
Joined: Tue Feb 12, 2008 7:11 pm

Post by das Monkey »

Wonderful. I'm glad I was able to make an (incredibly small :) ) contribution.

Something else I thought of that you may be interested in implementing (if it's not already there). I really like the Wikipedia window, but a lot of band names will bring up ambiguous results or just the wrong results altogether. This is the case for different panels for different reasons, but with Wikipedia, the solution seems to always be concatenating " (band)" to the end of the search for a direct result.

There could be a configuration screen or something, but a simple solution would be a small config file (perhaps inside the xml config) that mapped search terms to ones that would give more accurate direct results.

Something to consider anyway ...

Thanks for the great script!

das
linn
Posts: 170
Joined: Wed Sep 06, 2006 3:59 am

Can't get this url working

Post by linn »

In the"rightclick for web" script see : http://www.mediamonkey.com/forum/viewto ... highlight= i have this ini entry :
Group=Amazon
Caption=Artist/Album
URL=http://www.google.com/search?btnI&q=%22 ... amazon.com
this goes straight to the amazon results page.
I am trying to get this working in Webpanels but i get the google result page.
This is what i have :
<site>
<name>Amazon</name>
<caption>ama books</caption>
<description>Search current artist and album</description>
<start>http://www.google.com/</start>
<url>http://www.google.com/search?btnI&q=%22 ... n.com</url>
</site>

At startup i get a script message Object required root.... at websearch.vbs line 493 , column 8

I have tried variations but can't get it to work

Thank you in advance ,Lin
onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous »

Webnodes requires you to replace each "&" by "&" or the xml cannot be parsed properly - so perhaps the same is true here. Try this:

Code: Select all

<url>http://www.google.com/search?btnI&q=%22%artist%%22+%22%album%%22+site:amazon.com</url>
I don't have webpanels loaded so can't check though...
linn
Posts: 170
Joined: Wed Sep 06, 2006 3:59 am

Post by linn »

Thank you , it works spot on !

Lin

onenonymous wrote:Webnodes requires you to replace each "&" by "&" or the xml cannot be parsed properly - so perhaps the same is true here. Try this:

Code: Select all

<url>http://www.google.com/search?btnI&q=%22%artist%%22+%22%album%%22+site:amazon.com</url>
I don't have webpanels loaded so can't check though...
linn
Posts: 170
Joined: Wed Sep 06, 2006 3:59 am

can i call a webpanel other than playing the track ?

Post by linn »

i am using websearch panels to get book reviews ,
[img]http://image_farm3.static.flickr.com/2295/2338587438_0fe93627af_o.jpg[/img] i can,t get the image placeholder to show in the message.........
http://www.flickr.com/photos/linpinn/23 ... 8/sizes/o/
which works good ,in combination with " Lyrics and comment viewer " ,since i very seldom use the player , i use a mp3 player to listen to the books ,in order to get a websearch going , i have to "play" the track ;i was wondering if there is an alternative way to start the search ?

Thanks ,Lin
drjboulder
Posts: 1119
Joined: Mon Apr 09, 2007 12:03 am
Location: Boulder, Colorado, USA

Post by drjboulder »

I am wondering if it would be possible to modify Web Search Panels to have Comments saved to Comments tag and a custom field.
Specifically, Custom 4, so that I may use it in conjunction with my little experiment in thisthread.

I am guessing that if it is possible, that it would mean modifying this part of the code:

Code: Select all

' PanelToComment is called whenever the comments button is klicked
Sub PanelToComment(ByVal Item)
Dim NewComment

NewComment = GetWebSearchItems.PanelSearch(Item).Selection
If Len(NewComment) = 0 Then
' If there's nothing selected in current panel, let's try the clipboard...
NewComment = GetTextFromClipboard
End If

If Len(NewComment) > 10 Then
With SDB.Player.CurrentSong
If Len(.Comment) = 0 Then
.Comment = TextCleanUp(NewComment)
.UpdateDB
.WriteTags
Elseif MsgBox(stringsMsgOverwriteComment, vbYesNo) = vbYes Then
.Comment = TextCleanUp(NewComment)
.UpdateDB
.WriteTags
End If
End With
End If
End Sub
Any of you scripting genius's know if this is possible and willing to help out?
D Rock
Image
MediaMonkeyGoldv3.0.3.1183
Vista Home Basic|4thGen 20GPod
Zune Small Player Skin w/ Aqua 4 Player Mod
Backup | Last FM Node | Scrobbler DJ | TopTracks | StayInSameStyleDJ
RadioDJ | RadioFreeMonkey | PrettyPictures | MiniLyricsEmbedder
LyricsViewer | Lyricator | LyricsPlugin | VisualizationEmbedder | MonkeyRok
RightClickForWeb | WebSearchPanels | WebNodes | MagicNodes | FavoritesNodes
NowPlayingArtNode |AutoRateAccurate | TaggingInconsistencies
AdvancedDuplicateFind&Fix | CaseModify | PlayHistory&Stats | Etc...
onenonymous
Posts: 374
Joined: Sat Feb 02, 2008 1:09 pm
Location: Texas

Post by onenonymous »

drjboulder wrote:I am wondering if it would be possible to modify Web Search Panels to have Comments saved to Comments tag and a custom field.
Specifically, Custom 4, so that I may use it in conjunction with my little experiment in thisthread.
Any of you scripting genius's know if this is possible and willing to help out?
Here you go - 2 lines added - the ones with ".Custom4" in them...

Code: Select all

' PanelToComment is called whenever the comments button is klicked
Sub PanelToComment(ByVal Item)
    Dim NewComment
   
    NewComment = GetWebSearchItems.PanelSearch(Item).Selection
    If Len(NewComment) = 0 Then
        ' If there's nothing selected in current panel, let's try the clipboard...
      NewComment = GetTextFromClipboard
    End If

    If Len(NewComment) > 10 Then
        With SDB.Player.CurrentSong
            If Len(.Comment) = 0 Then
				.Comment = TextCleanUp(NewComment)
				.Custom4 = TextCleanUp(NewComment)
				.UpdateDB
				.WriteTags
            Elseif MsgBox(stringsMsgOverwriteComment, vbYesNo) = vbYes Then
				.Comment = TextCleanUp(NewComment)
				.Custom4 = TextCleanUp(NewComment)
				.UpdateDB
				.WriteTags
            End If
        End With
    End If
End Sub 
drjboulder
Posts: 1119
Joined: Mon Apr 09, 2007 12:03 am
Location: Boulder, Colorado, USA

Post by drjboulder »

Thanks a bunch, One.
Will have to wait till the Monkey is done extracting comments to custom 4 to give it a go.
Figured that it would be pretty simple. However, I know less about scripting than skinning and I have been pulling my hair out getting my Slim Player idea to work! :lol:

Edit:
Just tried it out...
Works great!
Thanks again!
D Rock
Image
MediaMonkeyGoldv3.0.3.1183
Vista Home Basic|4thGen 20GPod
Zune Small Player Skin w/ Aqua 4 Player Mod
Backup | Last FM Node | Scrobbler DJ | TopTracks | StayInSameStyleDJ
RadioDJ | RadioFreeMonkey | PrettyPictures | MiniLyricsEmbedder
LyricsViewer | Lyricator | LyricsPlugin | VisualizationEmbedder | MonkeyRok
RightClickForWeb | WebSearchPanels | WebNodes | MagicNodes | FavoritesNodes
NowPlayingArtNode |AutoRateAccurate | TaggingInconsistencies
AdvancedDuplicateFind&Fix | CaseModify | PlayHistory&Stats | Etc...
sommo

Post by sommo »

Thanks for this!
Post Reply