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.4.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for siegfried-0.0.4.tar.gz
Algorithm Hash digest
SHA256 561bb215a09ba6ade8e3cebfac11045e261d86185695c2e6c997b02e19973cd1
MD5 a57ff6e96d3bc817ba0b1598dfad4ccc
BLAKE2b-256 c7ecdbe891fe356c3e9bbc3590e30b215375dc8ec8eef0574175699c0b90cffe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for siegfried-0.0.4.macosx-10.9-intel.exe
Algorithm Hash digest
SHA256 92b3f3a7392ec1910f9c4c5628ea6ed6b775b7240524f33b264b366bdd9b85ad
MD5 c2991722f4eb3d5970df10c0c4edf515
BLAKE2b-256 4618f8f0d75a42484838396d4ea2206a0a024ff94d22dbb97dc529c5ad22cf9a

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