mmshivesh / pysnoonotes Goto Github PK
View Code? Open in Web Editor NEWSnoonotes API wrapper written in Python
License: MIT License
Snoonotes API wrapper written in Python
License: MIT License
Heya, I wanted to let you know about this:
['x']
{'NoteTypeID': x, 'SubName': 'x', 'Message': 'x', 'AppliesToUsername': 'x', 'Url': 'x'}
Traceback (most recent call last):
File "C:\Users\x\Desktop\reddit-bot\x\bot.py", line 101, in <module>
add_decay(author, subid)
File "C:\Users\x\Desktop\reddit-bot\x\bot.py", line 87, in add_decay
sn.add_note_for_user(author, 2310, "x", f"[{amoun}] x", f"x{subid}")
File "C:\Users\x\Desktop\reddit-bot\x\pysnoonotes\core.py", line 61, in add_note_for_user
self._authed_request("POST", "/api/note", data={
File "C:\Users\x\Desktop\reddit-bot\x\pysnoonotes\core.py", line 48, in _authed_request
return r.json()
File "C:\Users\x\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\x\AppData\Local\Programs\Python\Python38-32\lib\json\__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "C:\Users\x\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\x\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[Finished in 77.891s]
I added a print(data) below line 38 in core.py to get some context for this. The first line in my copypaste is my request for a user's snoonotes (their username), and below that is my request to POST a new note. I've substituted a lot of info with x, sorry about that.
It posts the note just fine though.
I added a
try:
return r.json()
except Exception as e:
print(e)
below the if r.ok:
, and it now just occasionally prints Expecting value: line 1 column 1 (char 0)
.
Thanks for writing this, it's been great so far!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.