http://www.perlmonks.org?node_id=1055046

Chris Micken has asked for the wisdom of the Perl Monks concerning the following question:

is there a script that can import Headlines from an internet URL- parse the data so it just displays Headlines to a html page that I can then push to a few monitors? In the past we had an activeperl script that worked.

Replies are listed 'Best First'.
Re: Parse headlines to HTML file
by hippo (Bishop) on Sep 20, 2013 at 15:34 UTC
    In the past we had an activeperl script that worked.

    Which prompts the obvious question: Why are you not still using it?

      the way the content is being delivered changed (Sat receiver) so it is not an option. now looking to get some the headlines via the web.

        So, it's really only the retrieval and parsing you are after since the rest of your old script would still apply? In which case look into LWP for the retrieval and HTML::Parser for the parsing. That should make fairly light work of it, hopefully.

Re: Parse headlines to HTML file
by Arunbear (Prior) on Sep 20, 2013 at 15:48 UTC

    By "Headlines" do you mean <h1> tags, <title> tags, or something else?

    There are a number of examples that you may be able to modify to do what you need (I have a vague memory of these being included in ActivePerl about a decade ago).
      Sorry. i mean headline news. A script that will grab some headlines every hour or so and create a clean html file or even text file.

        Are you expecting to get the news from an XML feed or by scraping an HTML page? And from which web site?

        Given the large number of ways that a news headline could be represented in terms of HTML out in the wild, it's unlikely that such a script exists (for parsing HTML at least).