Page 9 of 12

WebSearch Panels at Google code

Posted: Sun Feb 03, 2008 1:02 pm
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/

Posted: Sun Feb 03, 2008 5:05 pm
by gege
Hey, welcome back!

Posted: Sun Feb 03, 2008 5:42 pm
by jn
gege wrote:Hey, welcome back!
:D

Posted: Thu Feb 07, 2008 8:22 pm
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

Posted: Fri Feb 15, 2008 5:23 pm
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

Posted: Sat Feb 16, 2008 10:40 am
by jn
Very good idea, I modified the version in SVN.
Thank you!

Jörg

Posted: Tue Feb 19, 2008 5:31 am
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

Can't get this url working

Posted: Sat Mar 15, 2008 1:09 pm
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

Posted: Sat Mar 15, 2008 2:39 pm
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...

Posted: Sun Mar 16, 2008 4:34 am
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...

can i call a webpanel other than playing the track ?

Posted: Sun Mar 16, 2008 3:22 pm
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

Posted: Sun Apr 13, 2008 5:44 pm
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?

Posted: Sun Apr 13, 2008 6:04 pm
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 

Posted: Sun Apr 13, 2008 7:10 pm
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!

Posted: Sun Apr 20, 2008 6:18 am
by sommo
Thanks for this!