-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a46d83
commit b89411e
Showing
4 changed files
with
121 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import tweepy, re, time | ||
from access import * | ||
from random import randint | ||
|
||
# Setup API: | ||
# TODO | ||
|
||
# Function to extract status (will return status for post): | ||
def extract_status(path=None): | ||
# No path => return "No book opened!" | ||
# TODO | ||
|
||
# Try to search a sentence in book: | ||
try: | ||
# Open and read textbook: | ||
# TODO | ||
|
||
# If successfuly read, search sentence: | ||
# TODO | ||
except: | ||
# Book not found: | ||
# TODO | ||
|
||
# Function to search a sentence in book: | ||
def search_sentence(text): | ||
# Initialize status: | ||
# TODO | ||
|
||
# While we have a long or very short status: | ||
while not (5 < status < 125): | ||
# Generate a random number: | ||
# TODO | ||
|
||
# Set indices of sentence: | ||
# TODO | ||
|
||
# Replace breaks w/spaces: | ||
# TODO | ||
|
||
|
||
if __name__ == '__main__': | ||
# Setup Twitter API: | ||
# TODO | ||
|
||
# Set waiting time: | ||
segs = 3 | ||
|
||
# Eternal posting: | ||
while True: | ||
# Extract status: | ||
# TODO | ||
|
||
# Try to post status: | ||
# TODO | ||
|
||
# Wait till next sentence extraction: | ||
time.sleep(segs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import tweepy, time | ||
from access import * | ||
from random import randint | ||
|
||
# Setup API: | ||
def twitter_setup(): | ||
# Authenticate and access using keys: | ||
# TODO | ||
|
||
# Return API access: | ||
# TODO | ||
|
||
if __name__ == '__main__': | ||
# Setup Twitter API: | ||
# TODO | ||
|
||
# Set waiting time: | ||
secs = 3 | ||
|
||
# Set tweet list: | ||
tweetlist = ["Test tweet using #Python in @FerroRodolfo's workshop at the @pythondaymx \n#PythonDayMX17", | ||
" \n#PythonDayMX17", | ||
" \n#PythonDayMX17"] | ||
|
||
# Tweet posting: | ||
for tweet in tweetlist: | ||
# Print tweet: | ||
print(tweet) | ||
|
||
# Try to post tweet: | ||
# TODO | ||
|
||
# Wait till next sentence extraction: | ||
time.sleep(secs) |