View Single Post
Old 05-22-2014, 11:01 AM   #10
Snow Sciles
Connoisseur
Snow Sciles ought to be getting tired of karma fortunes by now.Snow Sciles ought to be getting tired of karma fortunes by now.Snow Sciles ought to be getting tired of karma fortunes by now.Snow Sciles ought to be getting tired of karma fortunes by now.Snow Sciles ought to be getting tired of karma fortunes by now.Snow Sciles ought to be getting tired of karma fortunes by now.Snow Sciles ought to be getting tired of karma fortunes by now.Snow Sciles ought to be getting tired of karma fortunes by now.Snow Sciles ought to be getting tired of karma fortunes by now.Snow Sciles ought to be getting tired of karma fortunes by now.Snow Sciles ought to be getting tired of karma fortunes by now.
 
Posts: 65
Karma: 400010
Join Date: Mar 2013
Location: London
Device: Nook STG, PW2
Thanks Chaley. I was eyeing the switch function, but thought perhaps I'm just doing something wrong with first_matching_cmp.

I found that I had to strcat the default.

Code:
program:

default  = strcat("https://en.wikipedia.org/w/index.php?search=", field('author'));
ao3        = "http://archiveofourown.org/works/search?work_search[creator]={author}";
ffnet      = "https://www.fanfiction.net/search.php?keywords={author}&ready=1&type=writer";

author_lookup = 
        switch(
           field('publisher'),
           '^archiveofourown.org$',
           ao3,
           '^fanfiction.net$',
           ffnet,
           default
        );


I'll continue to play around with GPM. Now that I've started, I'm trying to find things to do.
Snow Sciles is offline   Reply With Quote