Skip to content
This repository has been archived by the owner on Dec 28, 2020. It is now read-only.

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
palewire committed Jul 17, 2014
1 parent 02b1b25 commit b3a5b99
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
13 changes: 13 additions & 0 deletions docs/analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ Example usage:
.. code-block:: python
>>> import storytracker
>>> obj = storytracker.open_archive_filepath('/home/ben/archive/http!www.latimes.com!!!!@2014-07-06T16:31:57.697250.gz')
>>> obj.url
'http://www.latimes.com'
>>> obj.timestamp
datetime.datetime(2014, 7, 6, 16, 31, 57, 697250)
Expand All @@ -71,9 +73,12 @@ Example usage:
.. code-block:: python
>>> import storytracker
>>> obj_list = storytracker.open_archive_directory('/home/ben/archive/')
>>> obj_list[0].url
'http://www.latimes.com'
>>> obj_list[1].timestamp
datetime.datetime(2014, 7, 6, 16, 31, 57, 697250)
Expand All @@ -85,6 +90,14 @@ A hyperlink extracted from an :py:class:`ArchivedURL` object.

.. py:class:: Hyperlink
.. py:attribute:: contents
The contents of the anchor tag

.. py:attribute:: domain
The domain of the href

.. py:attribute:: href
The URL the hyperlink references
16 changes: 12 additions & 4 deletions docs/archiving.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ Example usage:
>>> # This will return gzipped content of the page to the variable
>>> obj = storytracker.archive("http://www.latimes.com")
<ArchivedURL: http://www.latimes.com@2014-07-17 04:08:32.169810+00:00>
>>> # You can save it to an automatically named file a directory you provide
>>> obj = storytracker.archive(http://www.latimes.com, output_dir="./")
>>> # If you'd prefer to have the HTML without compression
>>> obj = storytracker.archive("http://www.latimes.com", compress=False)
>>> obj = storytracker.archive("http://www.latimes.com", output_dir="./")
>>> obj.archive_path
'./http!www.latimes.com!!!!@2014-07-17T04:09:21.835271+00:00.gz'
Command-line interface
~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -88,6 +88,14 @@ Retrieves HTML from the provided URLs
:rtype: ``str``
:raises ValueError: If the response is not verified as HTML

Example usage:

.. code-block:: python
>>> import storytracker
>>> html = storytracker.get("http://www.latimes.com")
Command-line interface
~~~~~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletion docs/gettingstarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ This example would schedule the script to run a file like the one above at the t
that ``storytracker`` is available to your global Python installation at ``/usr/bin/python``. If you are using a virtualenv or different Python
configuration, you should begin the line with a path leading to that particular ``python`` executable.

.. code-block:: cron
.. code-block:: bash
0 * * * * /usr/bin/python /path/to/my/script/cron.py

0 comments on commit b3a5b99

Please sign in to comment.