|
@@ -9,15 +9,15 @@ import time
|
|
|
'''
|
|
|
Mastodon.create_app(
|
|
|
'grapeapp',
|
|
|
- api_base_url = 'https://noc.social/',
|
|
|
+ api_base_url = 'https://YOUR_MASTODON_BASE_URL/',
|
|
|
to_file = 'grapeapp_clientcred.secret'
|
|
|
)
|
|
|
'''
|
|
|
|
|
|
mastodon = Mastodon(client_id = 'grapeapp_clientcred.secret',)
|
|
|
mastodon.log_in(
|
|
|
- 'nocsocial@teets.us',
|
|
|
- 'WW936dQL1H0w9zLsWvyh3Z3e1yFrE39oYoxmdARCIk8IcrBH',
|
|
|
+ 'ENTER_YOUR_MASTODON_USERNAME',
|
|
|
+ 'ENTER_YOUR_MASTODON_PASSWORD',
|
|
|
to_file = 'grapeapp_usercred.secret'
|
|
|
)
|
|
|
|
|
@@ -44,7 +44,9 @@ while True:
|
|
|
cleanTags = re.compile('<.*?>')
|
|
|
tweetWithoutTags = re.sub(cleanTags, '', mostRecentMentionContent)
|
|
|
|
|
|
+ #put your bot's name and domain on the next line
|
|
|
cleanMention = re.compile('@developer(@noc\.social)*')
|
|
|
+
|
|
|
tweetWithoutMention = re.sub(cleanMention, '', tweetWithoutTags)
|
|
|
|
|
|
cleanTweet = re.sub(r'[^a-zA-Z0-9 ]', '', tweetWithoutMention)
|
|
@@ -63,6 +65,7 @@ while True:
|
|
|
mentionerTag = '@' + mostRecentMention.status.account.acct
|
|
|
print(mentionerTag)
|
|
|
|
|
|
+ #put the file path for your stable diffusion output on the next line
|
|
|
mediaId = mastodon.media_post(media_file = 'C:\\Users\\bigd\\Downloads\\stable-diffusion-main\\stable-diffusion-main\\outputs\\txt2img-samples\\' + folderName + '\\seed_28_00000.png', mime_type = 'image/png')
|
|
|
|
|
|
message = mentionerTag + ' mentioned me and said: "' + tweetWithoutMention.strip() + '". Here\'s my dream about that!'
|