[Message Prev][Message
Next][Thread Prev][Thread Next][Message
Index][Thread Index]
Re: Re: Slightly OT: Scraping tide info for house intranet page
Hi,
Personally I'd run 'em from a cron job once a day or so to generate a
static page...sounds like you're on windows tho, and that's really not
my bag. I can prolly cruft up some php for you if that helps?
cheers
ant
On Mon, May 26, 2008 at 4:17 PM, noel_pilot <HA@xxxxxxx> wrote:
> Hi Ant,
> Sorry for questions, that sounds perfect, my coding is almost minimal,
> can handle html and a tiny bit of php but not dabbled in much more,
> have found both ruby and perl extensions for dreamweaver (what I'd
> normally use for sites/editing). Any tips for how I'd get started
> with either of your suggestions or any sample reading material that
> might get me going!??!
>
> Thanks
>
> Noel
>
>
> --- In ukha_d@xxxxxxx, ant <blowback@...> wrote:
>>
>> Gah, GMail's wrapped it. In the perl, the line starting
"print" and
>> the next line should be joined. Same with the "Net::"
line in the
>> ruby.
>>
>> ant
>>
>> On Mon, May 26, 2008 at 2:35 AM, ant <blowback@...> wrote:
>> > here's a bit of perl that will do the job:
>> >
>> > #!/usr/bin/perl
>> > #
>> > use LWP::Simple;
>> >
>> > $url =
> "http://www.bbc.co.uk/weather/coast/tides/tides.shtml?date=20080527&loc=0027";
>> > $start_delim = "<!-- tide chart stats open
-->";
>> > $end_delim = "<!-- tide chart stats close
-->";
>> >
>> > my $content = get $url;
>> >
>> > if(defined($content)) {
>> > print "<table>\n$1\n</table>\n"
if($content =~
>> > /$start_delim(.*?)$end_delim/s);
>> > }
>> >
>> > Or some Ruby to do the same thing:
>> >
>> > #!/usr/bin/ruby
>> > require 'net/http'
>> >
>> > url =
> URI.parse("http://www.bbc.co.uk/weather/coast/tides/tides.shtml?date=20080527&loc=0027")
>> > start_delim = "<!-- tide chart stats open
-->"
>> > end_delim = "<!-- tide chart stats close -->"
>> >
>> > Net::HTTP.get(url).scan(/#{start_delim}(.*?)#{end_delim}/m) {
x
>> > print "<table>\n#{x}</table>\n" }
>> >
>> >
>> >
>> > cheers
>> >
>> > ant
>> >
>> >
>> >
>> > On Sun, May 25, 2008 at 5:14 PM, Wayne <Wayne@...>
wrote:
>> >> If your ok with a bit of coding - you could always hack
it out in
> real
>> >> time :)
>> >>
>> >> Wayne.
>> >>
>> >> James - SJ Computers wrote:
>> >>> You could use an iframe (Web Page inside another web
page)
>> >>>
>> >>> http://www.w3schools.com/TAGS/tag_iframe.asp
>> >>>
>> >>> James
>> >>>
>> >>> On Sun, May 25, 2008 at 9:33 AM, noel_pilot
<HA@...> wrote:
>> >>>
>> >>>
>> >>>> awesome good find, thanks, will prob use that
altho
> interested to know
>> >>>> how I could have scraped the other info if anyone
knows?!?!
>> >>>>
>> >>>> --- In ukha_d@xxxxxxx
<ukha_d%40yahoogroups.com>,
> "brougham Baker"
>> >>>> <bro-yahoo@> wrote:
>> >>>>
>> >>>>> From: "noel_pilot" <HA@>
>> >>>>>
>> >>>>>> Someone on here can hopefully help me,
starting to think
> about a home
>> >>>>>> intranet page with all useful stuff on
there and one think I
> like to
>> >>>>>> know is tides (i kitesurf as often as
possible).
>> >>>>>>
>> >>>>>> Easiest source of information for this
purpose I think is the
> bbc,
>> >>>>>>
>> >>>>> There are other sources-
>> >>>>>
>> >>>> http://www.googleminiapps.com/tools/tides-gadget/
>> >>>>
>> >>>>> for e.g. That looks to have plain text
output.
>> >>>>>
>> >>>>> My work mates also use the one on iGoogle
homepage too.
>> >>>>>
>> >>>>> Bro
>> >>>>>
>> >>>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>
>> >>>
>> >>> [Non-text portions of this message have been removed]
>> >>>
>> >>>
>> >>> ------------------------------------
>> >>>
>> >>> **** Sponsored By http://www.Berble.com ****
>> >>> **** Computers You Carry ****
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>
>> >>
>> >> ------------------------------------
>> >>
>> >> **** Sponsored By http://www.Berble.com ****
>> >> **** Computers You Carry ****
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >
>>
>
>
>
> ------------------------------------
>
> **** Sponsored By http://www.Berble.com ****
> **** Computers You Carry ****
>
>
>
>
>
>
------------------------------------
UKHA_D Main Index |
UKHA_D Thread Index |
UKHA_D Home |
Archives Home
|