Skip to content
Snippets Groups Projects
Commit 55646929 authored by PJ Metz's avatar PJ Metz
Browse files

full Maria PYthon, HHN "follow" and no JS mariah

parent a65eb798
No related branches found
No related tags found
No related merge requests found
......@@ -17,11 +17,12 @@ var config = require('./configPj.js');
var T = new Twit(config);
var stream = T.stream('statuses/filter', { track: '@HorrorNightsORL' });
var stream = T.stream('statuses/filter', { follow: '@HorrorNightsORL' });
stream.on('tweet', retweet_hhn);
function welcomeToTheFog(){
let date1 = new Date("2022/09/02");
......@@ -73,7 +74,7 @@ function retweet_hhn(tweet){
console.log("hold on to your butts...")
let id = tweet.id_str
if ((tweet.user.id == "339317066") && ( tweet.hasAttributes("quoted_status_id") == false)){
if ((tweet.user.id === "339317066") && ( quoted_status_id in tweet === false)){
try{
T.retweet(id);
}
......
require("./shania");
require("./botiana");
require("./mariah");
//require("./mariah");
require("./nsync.js");
require("./HHN22.js");
require("./bonethug.js");
......
......@@ -31,15 +31,15 @@ function tweetEvent(tweet) {
var name = tweet.user.screen_name;
let regex = /(👀🙄😒)/g;
let str = text;
let fantasy = str.match(regex) || [];
let fantasy = text.match(regex) || [];
let alwaysBeMyBaby = fantasy.length>0;
console.log(fantasy);
console.log(alwaysBeMyBaby);
// checks text of tweet for mention of Shania Bot
// checks text of tweet for mention of Mariah
if ((text.includes('@MechanicalCarey') && alwaysBeMyBaby === true)) {
// Start a reply back to the sender
......
from matplotlib.pyplot import install_repl_displayhook
import tweepy
import config_Mariah as conf
import re
import schedule as sched
import time
print("I don't want a lot for Christmas...")
......@@ -9,69 +13,50 @@ auth = tweepy.OAuth1UserHandler(conf.consumer_key, conf.consumer_secret, conf.ac
)
api = tweepy.API(auth)
# create class that handles stream
class LogTweets(tweepy.Stream):
def on_status(self, tweet):
#id and name from tweet object
id = tweet.id_str
name = tweet.user.screen_name
#covers getting extended tweets to check the text
try:
tweet = tweet.extended_tweet["full_text"]
except AttributeError:
tweet = tweet.text
#regex to see if emojis were used or creates empty list
regex_list = re.search("👀🙄😒") or []
#if list isn't empty, then regex worked.
sweet_fantasy = (len(regex_list) > 0)
#regex worked and tweet contains Mechanical Carey's name, reply text gets created and sent as an update
if (sweet_fantasy is True) and ("@MechanicalCarey" in tweet):
""" // Create an Twitter object to connect to Twitter API
const Twit = require('twit');
replyText = "@"+ name + "... I don't know her ¯\_(ツ)_/¯..."
// Pulling keys from another file
const config = require('./configM.js');
// Making a Twit object for connection to the API
const T = new Twit(config);
api.update_status(replyText, id)
else:
print("Just a Sweet Fantasy")
// Setting up a user stream
const stream = T.stream('statuses/filter', { track: '@MechanicalCarey' });
#creates instance of LogTweets with authentication
stream = LogTweets(conf.consumer_key, conf.consumer_secret, conf.access_token, conf.access_token_secret)
// Now looking for tweet events
// See: https://dev.twitter.com/streaming/userstreams
stream.on('tweet', tweetEvent);
#hashtags as str in list will be watched live on twitter.
// Here a tweet event is triggered!
function tweetEvent(tweet) {
stream.filter(track="@MechanicalCarey")
var id = tweet.id_str;
var text = tweet.text;
var name = tweet.user.screen_name;
let regex = /(👀🙄😒)/g;
let str = text;
let fantasy = str.match(regex) || [];
let alwaysBeMyBaby = fantasy.length>0;
console.log(fantasy);
console.log(alwaysBeMyBaby);
//from itsAydrian in twitch chat on 1/28 😘
let i = Math.floor(Math.random() * 3);
// checks text of tweet for mention of Shania Bot
if ((text.includes('@MechanicalCarey') && alwaysBeMyBaby === true)) {
// Start a reply back to the sender
const replyText = "@"+ name + "... I don't know her ¯\\_(ツ)_/¯... ‍";
// Post that tweet
T.post('statuses/update', { status: replyText, in_reply_to_status_id: id}, tweeted);
// Make sure it worked!
function tweeted(err, reply) {
if (err) {
console.log(err.message);
} else {
console.log('Tweeted: ' + reply.text);
}
}
} else {
console.log("Just a sweet sweet fantasy");
}
}; """
def AlwaysBeMyBaby():
print("You can't escape me")
api.update_status("Boy don't you know you can't escape me 😘 https://www.youtube.com/watch?v=Dxce3s7bV9s")
AlwaysBeMyBaby()
sched.every().day.at("11:00").do(AlwaysBeMyBaby)
while True:
sched.run_pending()
time.sleep(1)
#const job1 = schedule.scheduleJob(rule, AlwaysBeMyBaby);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment