Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hiro
GetTor
Commits
f3524221
Commit
f3524221
authored
Feb 15, 2016
by
ilv
Browse files
Changes made a while ago in getulum (production code)
parent
7b052eba
Changes
2
Show whitespace changes
Inline
Side-by-side
gettor/twitter.py
View file @
f3524221
...
...
@@ -212,33 +212,31 @@ class TwitterBot(object):
sender_id
=
dm
[
'sender'
][
'id_str'
]
msg
=
dm
[
'text'
].
strip
().
lower
()
bogus_req
uest
=
False
req
uest
=
None
bogus_req
=
False
req
=
None
status
=
''
try
:
if
self
.
_is_blacklisted
(
str
(
sender_id
)):
self
.
log
.
info
(
'blacklist; none; none'
)
bogus_req
uest
=
True
bogus_req
=
True
if
not
bogus_req
uest
:
if
not
bogus_req
:
self
.
log
.
debug
(
"Request seems legit, let's parse it"
)
# let's try to guess what the user is asking
req
uest
=
self
.
parse_text
(
str
(
msg
))
req
=
self
.
parse_text
(
str
(
msg
))
# possible options: links, mirrors, help
if
req
uest
[
'type'
]
==
'links'
:
if
req
[
'type'
]
==
'links'
:
self
.
log
.
info
(
'links; %s; %s'
%
(
req
[
'os'
],
req
[
'lc'
]))
links
=
self
.
core
.
get_links
(
'Twitter'
,
request
[
'os'
],
request
[
'lc'
]
'twitter'
,
req
[
'os'
],
req
[
'lc'
]
)
reply
=
self
.
_get_msg
(
'links'
,
'en'
)
reply
=
reply
%
(
req
uest
[
'os'
],
req
uest
[
'lc'
],
links
)
reply
=
reply
%
(
req
[
'os'
],
req
[
'lc'
],
links
)
elif
req
uest
[
'type'
]
==
'mirrors'
:
elif
req
[
'type'
]
==
'mirrors'
:
self
.
log
.
info
(
'mirrors; none; %s'
%
req
[
'lc'
])
reply
=
self
.
_get_msg
(
'mirrors'
,
'en'
)
try
:
...
...
upload/bundles2dropbox.py
View file @
f3524221
...
...
@@ -140,11 +140,7 @@ if __name__ == '__main__':
elif
p3
.
match
(
file
):
osys
,
arch
,
lc
=
get_bundle_info
(
file
,
'osx'
)
link
=
"Tor Browser %s-bit:
\n
%s$Tor Browser's signature %s-bit:"
\
"
\n
%s$SHA256 checksum of Tor Browser %s-bit (advanced):"
\
"
\n
%s$"
%
\
(
arch
,
link_file
[
u
'url'
],
arch
,
link_asc
[
u
'url'
],
arch
,
sha_file
)
link
=
"%s$%s$%s$"
%
(
link_file
[
u
'url'
],
link_asc
[
u
'url'
],
sha_file
)
# note that you should only upload bundles for supported locales
core
.
add_link
(
'Dropbox'
,
osys
,
lc
,
link
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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