I am unable to understand what is wrong with my code.when i run it,it gives me the error-RuntimeError: API_KEY not set.please help.Thanks
`import os import sys from helpers import get_user_timeline
from analyzer import Analyzer from termcolor import colored
def main():
# ensure proper usage
if len(sys.argv) != 2:
sys.exit("Usage: ./tweets @screen name")
user_handle=sys.argv[1].lstrip("@")
print(user_handle)
# absolute paths to lists
positives = os.path.join(sys.path[0], "positive-words.txt")
negatives = os.path.join(sys.path[0], "negative-words.txt")
tweets = get_user_timeline(user_handle, 50)
if tweets == None:
sys.exit("Not a valid screen name")
# instantiate analyzer
analyzer = Analyzer(positives, negatives)
for tweet in tweets:
score = analyzer.analyze(tweet)
if score > 0.0:
print(colored("{} {}".format(score, tweet), "green"))
elif score < 0.0:
print(colored("{} {}".format(score, tweet), "red"))
else:
print(colored("{} {}".format(score, tweet), "yellow"))
if name == "main": main() `