Re: dynamically set header

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: dynamically set header

Benjamin Hitz
Cecilia -
I am trying to get the gbrowse list back in the loop.  I think that  the URL is just a striing as far a perl is concerned, so if you can stringify the datasouse or set up a datasource => URL hash in init_code it should probably work.

You should also make sure that the curl executable is in /usr/bin or otherwise find it on your gbrowse machine...

Ben
On Mar 21, 2011, at 10:39 PM, [hidden email] wrote:

> Hi Ben,
>
> I'm impressed with your solution. Is it able to dynamically set the URL passed to curl_div() depending on the data source? For example, if GB2 data source is volvox, get header from volvox.html. If it is yeast db, get from yeast.html
>
> Sorry to send you email directly. I tried to reply to the original thread but it forbid me as it is 'restricted area'.
>
> Cheers,
> Cecilia
>
> --- GBrowse.conf ---
> init_code = sub curl_div {
>                my $url = shift;
>              my @raw = `/usr/bin/curl $url 2>&1`;
>              my $div = '';
>                while ($_ = shift @raw) {
>                        if (/div id/) {
>                                unshift (@raw,$_);
>                                last;
>                        }
>                }
>                $div = join('', (grep {/\w+/} @raw));
>                return $div;
>         }
>
> header =  sub { &curl_div("http://fasolt.stanford.edu/cgi-bin/toolbar.pl") }

--
Ben Hitz
Senior Scientific Programmer ** Saccharomyces Genome Database ** GO Consortium
Stanford University ** [hidden email]




------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse