Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
D
DivasLive
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
Pj Metz
DivasLive
Commits
55646929
Commit
55646929
authored
2 years ago
by
PJ Metz
Browse files
Options
Downloads
Patches
Plain Diff
full Maria PYthon, HHN "follow" and no JS mariah
parent
a65eb798
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
HHN22.js
+3
-2
3 additions, 2 deletions
HHN22.js
divas.js
+1
-1
1 addition, 1 deletion
divas.js
mariah.js
+3
-3
3 additions, 3 deletions
mariah.js
mariah.py
+35
-50
35 additions, 50 deletions
mariah.py
with
42 additions
and
56 deletions
HHN22.js
+
3
−
2
View file @
55646929
...
...
@@ -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
);
}
...
...
This diff is collapsed.
Click to expand it.
divas.js
+
1
−
1
View file @
55646929
require
(
"
./shania
"
);
require
(
"
./botiana
"
);
require
(
"
./mariah
"
);
//
require("./mariah");
require
(
"
./nsync.js
"
);
require
(
"
./HHN22.js
"
);
require
(
"
./bonethug.js
"
);
...
...
This diff is collapsed.
Click to expand it.
mariah.js
+
3
−
3
View file @
55646929
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
mariah.py
+
35
−
50
View file @
55646929
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);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment