Commits

Gregory Petukhov committed 461d73c

Update readme

  • Participants
  • Parent commits 6d10dbf

Comments (0)

Files changed (1)

    That command download fresh version of links database.
    Sample cron entry: * * * * * cd /web/project; ./manage.py sape_refresh
  * Put `{{ sape.links|join:", " }} on appropriate place in the site's templates
- 
+
 
 Usage in arbitrary python project
 =================================
  * Write script which calls sape.provider.refresh_local_database function and passes
    it correct arguments (path to local database, sape.ru account ID, site hostname)
  * Call that script periodically with cron or anything else
- * Use sape.client.SapeClient instance to get links for the page.
+ * Use sape.client.Client instance to get links for the page.
+
+
+Example of Client usage
+=======================
+
+    from sape.client import Client
+
+    url = 'http://mydomain.com/cat/subcat/?foo=bar'
+    client = Client('var/links.db', url)
+    links = client.links()
+
+
+Example of Provider usage
+=========================
+
+    from sape.provider import refresh_local_database
+
+    refresh_local_database('var/links.db', 'sape.ru ID', 'mydomain.com')