Skip to main content

Tools for taming links.

Project description

.. figure:: https://travis-ci.org/newslynx/siegfried.svg
:alt: travis-img

travis-img
siegfried
=========

Tools for taming lynx.

Install
-------

::

pip install siegfried

Test
----

requires ``nose``

::

nosetests

Usage
-----

This module contains various methods that are used throughout
``newslnyx``. but the main functions are ``unshorten_url``,
``is_article_url``, and ``prepare_url``:

.. code:: python

from siegfried import (
unshorten_url, is_article_url, prepare_url
)

print unshorten_url('bit.ly/1j3SrUC')
# http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism/

print is_article_url(
'http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism'
)
# True

print is_article_url(
'http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism',
pattern = r'.*towcenter\.org/blog/.*'
)
# True

import re
pattern = re.compile(r'.*towcenter\.org/blog/.*')
print is_article_url(
'http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism',
pattern = pattern
)
# True

print prepare_url(
'http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism/?q=lfjad&f=lkfdjsal'
)
# http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

siegfried-0.0.5.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

siegfried-0.0.5.macosx-10.9-intel.exe (72.3 kB view details)

Uploaded Source

File details

Details for the file siegfried-0.0.5.tar.gz.

File metadata

  • Download URL: siegfried-0.0.5.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for siegfried-0.0.5.tar.gz
Algorithm Hash digest
SHA256 7aa013f6b76fd8f46049db6d030425cee6e439036f7f85407d554a206aef6c4c
MD5 15f01f5355eb91b9fbcb8bbd2e8eaedb
BLAKE2b-256 627fa3293b13fa27885f89f3dc5e4f93566fc20584e6183df7478d0eecc4d21e

See more details on using hashes here.

File details

Details for the file siegfried-0.0.5.macosx-10.9-intel.exe.

File metadata

File hashes

Hashes for siegfried-0.0.5.macosx-10.9-intel.exe
Algorithm Hash digest
SHA256 c70a87ce9d21fdd87d6084a8c45e833a4239315684fd5c4d2bff97fc20c520fd
MD5 ea523fde66609ef66b017480116b7242
BLAKE2b-256 f98321b6c149971d078dfdaf985322b2f8799b9104660b9febb70bc0ed4fb0e0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page