Skip to content

alosultan/wallabag_api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wallabag API

Python API for Wallabag v2

Requirements :

  • requests 2.5.0

Installation:

to get the project, from your virtualenv, do :

git clone https://github.com/foxmask/wallabag-api/

or

pip install wallabag_api

Creating a post :

  1. request the token, if you don't have it yet
  2. create the post
from wallabag_api.wallabag import Wallabag
# settings
params = {'username': 'foxmask',
          'password': 'mypass',
          'client_id': 'myid',
          'client_secret': 'mysecret'}
my_host = 'http://localhost:8080'
# get token
token = Wallabag.get_token(host=my_host, **params)

# create a post
wall = Wallabag(host=my_host, client_secret='mysecret', client_id='myid', token=token)

my_url = 'https://blog.trigger-happy.eu'
my_title = 'Trigger Happy blog'
my_tags = ['python', 'wallabag']

wall.post_entries(url=my_url, title=my_title, tags=my_tags)

this will give you something like this :

https://github.com/foxmask/wallabag_api/blob/master/wallabag.png

Testing :

Install Wallabag V2 on your own host like explain here http://doc.wallabag.org/en/v2/user/installation.html

Then create a client API like explain here http://doc.wallabag.org/en/v2/developer/api.html

this will give you somthing like this

https://github.com/foxmask/wallabag_api/blob/master/wallabag_api_key.png

Then replace the client_id / client_secret / login / pass to wallabag_test.py and run

python wallabag_test.py

About

Python API for Wallabag

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%