Author Topic: URL Help  (Read 3934 times)

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9383
As part of my Custom Web Links, I have Google, Bing, and DuckDuckGo set up to do lyrics searches based on artist and track title. They've been working well for a while, but now I'm running into an issue where anything after an ampersand (&) isn't being passed to the search.  For example I select a track by "Crosby, Stills, Nash & Young" only "Crosby, Stills, Nash" is passed on. Needless to say, I'm getting no results despite the fact that the track in question comes up with lyrics if I manually add & Young to the search field. In this example, if I change the artist to "Crosby, Stills, Nash and Young" but that's not the band's name per the CD.

The links I'm using are as such:
Google: https://www.google.com/search?q=$First(<Artist>)+$Split(<Title>,"(",1)
Bing: http://bing.com/search?q=$First(<Artist>)+$Split(<Title>,"(",1)+Lyrics
DuckDuckGo: https://duckduckgo.com/?q=search&q=$First(<Artist>)+$Split(<Title>,"(",1)+Lyrics

Is there any way to get MB to pass the & along with the text that follows, to get valid results?

Thanks.
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

Aevaris

  • Jr. Member
  • **
  • Posts: 56
I'm unfamiliar with MBs string manipulation, but some ideas from general string experience:
- Do you need to / can you specify the string as a literal?
- Is there a way to escape characters?

redwing

  • Guest
Use $Replace($First(<Artist>),&,and) in place of $First(<Artist>)

https://www.google.com/search?q=$Replace($First(<Artist>),&,and)+$Split(<Title>,"(",1)

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9383
Thanks redwing. A couple of quick tests and it's now working as expected. I'll do some in-depth testing later today.
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here