Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
rpteam
wantzel
Commits
7c96c2b8
Commit
7c96c2b8
authored
Aug 03, 2019
by
Mindiell
Browse files
Ok, testing return code for API is fixed
parent
b40fcf42
Changes
1
Hide whitespace changes
Inline
Side-by-side
rp.py
View file @
7c96c2b8
...
...
@@ -337,6 +337,7 @@ class Rp():
self
.
count_articles
()
# Do the same for new RP
Log
.
debug
(
"Adding article to new RP"
)
headers
=
{
"Authorization"
:
config
.
token
}
data
=
{
"url"
:
url
,
...
...
@@ -344,14 +345,16 @@ class Rp():
"archive"
:
True
if
"a"
in
command
else
False
,
"quote"
:
True
if
command
.
count
(
"p"
)
>
1
else
False
,
}
Log
.
debug
(
data
)
result
=
requests
.
post
(
"%s/articles/"
%
config
.
api
,
data
=
data
,
headers
=
headers
)
if
result
.
code
=
=
200
:
if
result
.
status_
code
>
=
200
and
result
.
status_code
<
300
:
article
=
json
.
loads
(
result
.
text
)
note
=
article
[
"score"
]
answer
=
True
if
answer
:
# Answer is now based on where, who, note, and a little magic
return
self
.
did_rp
(
channel
,
user
,
note
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment