Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BabelZoo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PLN
BabelZoo
Commits
982d93d8
Unverified
Commit
982d93d8
authored
Nov 18, 2019
by
PLN (Algolia)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Tweeper
parent
abd741fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
.gitignore
.gitignore
+1
-0
selection.txt
KoozDawa/output/selection.txt
+0
-0
tweeper.py
KoozDawa/tweeper.py
+32
-0
No files found.
.gitignore
View file @
982d93d8
...
...
@@ -132,4 +132,5 @@ dmypy.json
.idea/
# Outputs
output/*.txt
output/
KoozDawa/output/selection.txt
deleted
100644 → 0
View file @
abd741fe
KoozDawa/tweeper.py
View file @
982d93d8
import
os
import
tweepy
from
didyoumean3.didyoumean
import
did_you_mean
class
Tweeper
(
object
):
def
__init__
(
self
):
auth
=
tweepy
.
OAuthHandler
(
os
.
environ
[
"ZOO_DAWA_KEY"
],
os
.
environ
[
"ZOO_DAWA_KEY_SECRET"
])
auth
.
set_access_token
(
os
.
environ
[
"ZOO_DAWA_TOKEN"
],
os
.
environ
[
"ZOO_DAWA_TOKEN_SECRET"
])
self
.
api
=
tweepy
.
API
(
auth
)
def
tweet
(
self
,
message
):
"""Tweets a message after spellchecking it."""
message
=
did_you_mean
(
message
)
self
.
api
.
update_status
(
message
)
def
main
():
Tweeper
()
.
tweet
(
"tête daffiche comme la cannelle"
)
# Authenticate to Twitter
if
__name__
==
'__main__'
:
main
()
Write
Preview
Markdown
is supported
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