More > JRiver Media Center 21 for Windows
• MrC's Tip of the Week 2013.36: Links
RoderickGI:
Here is another hint.
Use the examples above to see what is required for a search. For example, with www.metal-archives.com above, if you go to the site and search for a band that doesn't exist (Deaf Leopard in my case), then the URL shown is something like this:
https://www.metal-archives.com/search?searchString=Deaf+Leopard&type=band_name
Now compare that to the string in Slayerist's example above:
<Item Name="Search URL">http:////metal-archives.com//search?searchString=Replace([artist],/ ,+)&type=band_name</Item>
It is easy to see what needs to be done. It is all about finding out the correct search string used for a site and then building it using the Expression Language and tags that exist in MC. Then the rest is just about filtering results and so on.
I haven't built a lot, but once you see what is required, it isn't that onerous.
& is required to insert "&" into a URL, and in other situations. Google will explain.
"/" is the escape character used in the Expression Language to allow you to pass a real "/" to a URL. Hence "////" is read as "//" and "//" as "/".
FrankEPaul:
Hi Roderick
Thanks for taking the time to explain all that.
When I first checked out those other coding examples, I did sort of inadvertently end up trying to replicate bits of code in relation to the other sites I'm interested in, trying to see if I could figure out which bits applied and which didn't. Based on your advice, it sounds as though I need to try that a bit further. I guess I gave up when and where I did out of a sense of not having a feel for the underlying logic and thus copy-and-pasting kind of blind. Perhaps boning up on the expression language and then trying your deductive approach again will make it become easier. In any event, I appreciate your help!
Cheers
Frank
drmimosa:
MrC, you are missed around here. Thanks for your help and contributions.
terrya64:
I am hoping someone can help with the proper coding for a couple external searches.
I have been trying to get artist search links working to:
https://rateyourmusic.com/
http://www.musicvf.com/
Not sure what I'm doing wrong but can't get these to work right.
thanks!!
RoderickGI:
You just need to work out the search URL used by the site and structure that into a link, as per my post here https://yabb.jriver.com/interact/index.php/topic,83371.msg782412.html#msg782412, plus complete the other bits of the link.
The only complex bits are the Replace function, using the "&", and making sure you escape any special characters such as "/" with a "/", which means using the following character literally. Hence in the Replace command "/ ,+" means literally replacing the Space with a "+" character.
The RateYourMusic site seems to have a pretty simple search engine, and it returns a list of Artists that match or come close, rather than a single Artist.
Using my Deaf Leopard example, the search URL for an Artist search is:
https://rateyourmusic.com/search?searchtype=a&searchterm=Deaf+Leopard
Which codes into the following Search URL using tags in MC:
<Item Name="Search URL">https:////rateyourmusic.com//search?searchtype=a&searchterm=Replace([artist],/ ,+)</Item>
So the full code you can paste into the Links dialogue is:
--- Code: ---<Link version="1.2">
<Item Name="Name">RateYourMusic</Item>
<Item Name="Action">2</Item>
<Item Name="Base URL">https:////rateyourmusic.com//</Item>
<Item Name="Search URL">https:////rateyourmusic.com//search?searchtype=a&searchterm=Replace([artist],/ ,+)</Item>
</Link>
--- End code ---
As per Marko's instructions above, copy that and use the "Paste Link Information From Clipboard" in the Manage Links dialogue.
Note that;
<Item Name="Action">0</Item>
opens the result in the same tab inside MC.
<Item Name="Action">1</Item>
opens the result in an external browser.
<Item Name="Action">2</Item>
opens the result in a new tab inside MC. My preferred option.
Choose which you prefer.
Music VF is similar.
--- Code: ---<Link version="1.2">
<Item Name="Name">MusicVF</Item>
<Item Name="Action">2</Item>
<Item Name="Base URL">http:////www.musicvf.com//</Item>
<Item Name="Search URL">http:////www.musicvf.com//search.php?searchtype=searchartist&searchstring=Replace([artist],/ ,+)</Item>
</Link>
--- End code ---
I tested both and they work.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version