From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Source code to check URLs in an org mode document? Date: Sat, 5 Apr 2014 09:50:48 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b5db56cf40e0404f64beb1f Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWQzj-0008FE-3f for emacs-orgmode@gnu.org; Sat, 05 Apr 2014 09:50:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WWQzh-0007iK-SP for emacs-orgmode@gnu.org; Sat, 05 Apr 2014 09:50:51 -0400 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]:59478) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWQzh-0007i6-Hv for emacs-orgmode@gnu.org; Sat, 05 Apr 2014 09:50:49 -0400 Received: by mail-pa0-f50.google.com with SMTP id kq14so4717934pab.37 for ; Sat, 05 Apr 2014 06:50:48 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Grant Rettke Cc: "emacs-orgmode@gnu.org" --047d7b5db56cf40e0404f64beb1f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable You can parse the buffer, and run some code on all of the links. I did something like this here http://kitchingroup.cheme.cmu.edu/blog/2013/09/28/Changing-links-to-files-s= o-they-work-in-a-blog/for another reason. You could adapt that to do your link validation. I guess you will need to send a request to the url to see if it is valid. John ----------------------------------- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu On Fri, Apr 4, 2014 at 10:23 PM, Grant Rettke wrot= e: > Hi, > > One of my documents has ~200 HTML links in the footnotes. > > Wondering how folks check the links? > > My goal is that: > 1. Each footnote with a URL is evaluated > 2. They are evaluated to determine whether the URL is valid > 3. Check whether or not the page exists > 4. Add some indicate in the footnote that it was found not to be up on > some date. > > This might require some custom coding, no? > > Regards, > > Grant Rettke | AAAS, ACM, AMA, COG, FSF, IEEE, Sigma Xi > grettke@acm.org | http://www.wisdomandwonder.com/ > =E2=80=9CWisdom begins in wonder.=E2=80=9D --Socrates > ((=CE=BB (x) (x x)) (=CE=BB (x) (x x))) > =E2=80=9CLife has become immeasurably better since I have been forced to = stop > taking it seriously.=E2=80=9D --Thompson > > --047d7b5db56cf40e0404f64beb1f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
You can parse the buffer, and run some code on all of the = links. I did something like this here ht= tp://kitchingroup.cheme.cmu.edu/blog/2013/09/28/Changing-links-to-files-so-= they-work-in-a-blog/ for another reason. You could adapt that to do you= r link validation. I guess you will need to send a request to the url to se= e if it is valid.

John

-------= ----------------------------
John Kitchin
Associate Professor
Dohe= rty Hall A207F
Department of Chemical Engineering
Carnegie Mellon Uni= versity
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

<= /div>

On Fri, Apr 4, 2014 at 10:23 PM, Grant R= ettke <gcr@wisdomandwonder.com> wrote:
Hi,

One of my documents has ~200 HTML links in the footnotes.

Wondering how folks check the links?

My goal is that:
1. Each footnote with a URL is evaluated
2. They are evaluated to determine whether the URL is valid
3. Check whether or not the page exists
4. Add some indicate in the footnote that it was found not to be up on
some date.

This might require some custom coding, no?

Regards,

Grant Rettke | AAAS, ACM, AMA, COG, FSF, IEEE, Sigma Xi
grettke@acm.org | http://www.wisdomandwonder.com/=
=E2=80=9CWisdom begins in wonder.=E2=80=9D --Socrates
((=CE=BB (x) (x x)) (=CE=BB (x) (x x)))
=E2=80=9CLife has become immeasurably better since I have been forced to st= op
taking it seriously.=E2=80=9D --Thompson


--047d7b5db56cf40e0404f64beb1f--