Add conkys and wallpapers
This commit is contained in:
26
.conky/scripts/pocket.py
Executable file
26
.conky/scripts/pocket.py
Executable file
@@ -0,0 +1,26 @@
|
||||
#! /usr/bin/env python
|
||||
|
||||
import urllib2
|
||||
import urllib
|
||||
import json
|
||||
from subprocess import call
|
||||
from os.path import expanduser
|
||||
import time
|
||||
|
||||
json_data=open(expanduser('~')+'/.conky/scripts/.passwords.json')
|
||||
data = json.load(json_data)
|
||||
key=data['pocket']['key']
|
||||
access_token=data['pocket']['access_token']
|
||||
|
||||
|
||||
data = {'consumer_key': key, 'access_token': access_token}
|
||||
data = urllib.urlencode(data)
|
||||
|
||||
request = urllib2.Request("https://getpocket.com/v3/stats")
|
||||
|
||||
j = urllib2.urlopen(request, data)
|
||||
json_data = j.read()
|
||||
j_obj = json.loads(json_data)
|
||||
|
||||
|
||||
print "${color1}Pocket Unread: ${alignr}${color white}%d" %(j_obj['count_unread'])
|
||||
Reference in New Issue
Block a user