1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-23 04:23:08 +00:00

This is a Perl script that extracts URLs from correctly-encoded MIME

email messages or plain text. This can be used either as a
pre-parser for urlview, or to replace urlview entirely.

This is designed primarily for use with the mutt emailer. The idea
is that if you want to access a URL in an email, you pipe the email
to a URL extractor (like this one) which then lets you select a URL
to view in some third program (such as Firefox). An alternative
design is to access URLs from within mutt's pager by defining macros
and tagging the URLs in the display to indicate which macro to use.
A script you can use to do that is tagurl.pl.

Main features:
    - Configurable
    - Handles URLs that have been broken over several lines in
      format=flowed delsp=yes email messages
    - Handles quoted-printable email messages
    - Sanitizes URLs so that they can't break out of the command shell

WWW: http://www.memoryhole.net/~kyle/extract_url/

PR:		ports/180022
Submitted by:	Horia Racoviceanu <horia@racoviceanu.com>
Approved by:	wg (mentor)
This commit is contained in:
Rusmir Dusko 2013-10-24 15:39:27 +00:00
parent 7e984d580c
commit 1724ff2173
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=331496
7 changed files with 124 additions and 0 deletions

View File

@ -173,6 +173,7 @@
SUBDIR += exmpp
SUBDIR += expat2
SUBDIR += exslt
SUBDIR += extract_url
SUBDIR += ezxml
SUBDIR += fa-aspell
SUBDIR += fcitx-m17n

View File

@ -0,0 +1,56 @@
# Created by: Horia Racoviceanu <horia@racoviceanu.com>
# $FreeBSD$
PORTNAME= extract_url
PORTVERSION= 1.5.8
CATEGORIES= textproc
MASTER_SITES= GOOGLE_CODE
PROJECTHOST= extracturl
MAINTAINER= horia@racoviceanu.com
COMMENT= Perl script that extracts URLs from email in MIME or plain text format
LICENSE= BSD
BUILD_DEPENDS= p5-MIME-Tools>=0:${PORTSDIR}/mail/p5-MIME-Tools \
p5-HTML-Parser>=0:${PORTSDIR}/www/p5-HTML-Parser
RUN_DEPENDS:= ${BUILD_DEPENDS}
USES= gmake perl5
MAKE_ARGS= all prefix=${PREFIX} man_prefix=${PREFIX}
WRKSRC= ${WRKDIR}/${PORTNAME}
SUB_FILES= pkg-message
OPTIONS_DEFINE= DOCS GETOPT_LONG URI_FIND
OPTIONS_RADIO= URL_SELECTOR
OPTIONS_RADIO_URL_SELECTOR= CURSES_UI URLVIEW
OPTIONS_DEFAULT= CURSES_UI GETOPT_LONG URI_FIND
CURSES_UI_DESC= Allows it to fully replace urlview
GETOPT_LONG_DESC= Recognizes long options --version and --list
URI_FIND_DESC= Recognizes more exotic URL variations in plain text
URLVIEW_DESC= Uses urlview for the URL selector menu
OPTIONS_SUB= yes
CURSES_UI_RUN_DEPENDS= p5-Curses-UI>=0:${PORTSDIR}/devel/p5-Curses-UI
GETOPT_LONG_RUN_DEPENDS= p5-Getopt-Long>=0:${PORTSDIR}/devel/p5-Getopt-Long
URLVIEW_RUN_DEPENDS= urlview>=0:${PORTSDIR}/textproc/urlview
URI_FIND_RUN_DEPENDS= p5-URI-Find>=0:${PORTSDIR}/textproc/p5-URI-Find
PORTDOCS= AUTHORS NEWS README
post-patch:
@${REINPLACE_CMD} '/pod2man.mk/s|make|${GMAKE}|' \
${WRKSRC}/${MAKEFILE}
post-install:
${INSTALL_DATA} ${FILESDIR}/${PORTNAME}view ${STAGEDIR}${PREFIX}/etc/${PORTNAME}view.sample
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
SHA256 (extract_url-1.5.8.tar.gz) = 58eac907cb926deba74ab81e7503a1055fd3cbe20952f011d8e6b75da12d6bcc
SIZE (extract_url-1.5.8.tar.gz) = 13861

View File

@ -0,0 +1,31 @@
################################
### extract_url(1) configuration
#
# Copy this file to ~/.extract_urlview
# Command used to view URLs
#COMMAND firefox %s &
# URL will be opened without prompting when emails contains only one
#SHORTCUT
# Turn off showing the full URL before opening it
#NOREVIEW
# Disable the automatic exit of URL selection menu after viewing a URL
#PERSISTENT
# Ignore links that don't correspond to any text
#IGNORE_EMPTY_TAGS
# Specify which HTML tags will be examined for URLs
#HTML_TAGS a,applet,area,blockquote,embed,form,frame,iframe,input,ins,isindex,head,layer,link,object,q,script,xmp
# Key for PERSISTENT behaviour, or opposite if PERSISTENT is specified
#ALTSELECT k
# Show [url] list or show URLs in [context] when the program is run
#DEFAULT_VIEW url
# Sanitize URLs before they are displayed
#DISPLAY_SANITIZED

View File

@ -0,0 +1,9 @@
===============================================================================
extract_url has been installed.
Sample configuration is installed, please adjust it
%%PREFIX%%/etc/extract_urlview.sample
===============================================================================

View File

@ -0,0 +1,20 @@
This is a Perl script that extracts URLs from correctly-encoded MIME
email messages or plain text. This can be used either as a
pre-parser for urlview, or to replace urlview entirely.
This is designed primarily for use with the mutt emailer. The idea
is that if you want to access a URL in an email, you pipe the email
to a URL extractor (like this one) which then lets you select a URL
to view in some third program (such as Firefox). An alternative
design is to access URLs from within mutt's pager by defining macros
and tagging the URLs in the display to indicate which macro to use.
A script you can use to do that is tagurl.pl.
Main features:
- Configurable
- Handles URLs that have been broken over several lines in
format=flowed delsp=yes email messages
- Handles quoted-printable email messages
- Sanitizes URLs so that they can't break out of the command shell
WWW: http://www.memoryhole.net/~kyle/extract_url/

View File

@ -0,0 +1,5 @@
bin/extract_url
@unexec if cmp -s %D/etc/extract_urlview %D/etc/extract_urlview.sample ; then rm -f %D/etc/extract_urlview ; fi
etc/extract_urlview.sample
@exec if [ -f %D/etc/extract_urlview ] ; then cp -p %D/%F %B/extract_urlview ; fi
man/man1/extract_url.1.gz