elephrame 0.5 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +0,0 @@
1
- require 'elephrame'
2
-
3
- # create a bot that watches the public timeline
4
- # (this gives us the largest sample size)
5
- watcher = Elephrame::Bots::Watcher.new 'public'
6
-
7
- watcher.run do |bot, post|
8
-
9
- # if the account's profile doesn't contain no bot
10
- # we print the account's handle and the post's content
11
- if not bot.no_bot? post.account.id
12
- puts "#{post.account.acct}: #{post.content}"
13
- end
14
- end
data/examples/periodic.rb DELETED
@@ -1,7 +0,0 @@
1
- require 'elephrame'
2
-
3
- periodic = Elephrame::Bots::Periodic.new '10s'
4
-
5
- periodic.run do |bot|
6
- bot.post('testing', visibility: 'direct')
7
- end
@@ -1,19 +0,0 @@
1
- require 'elephrame'
2
-
3
- mix = Elephrame::Bots::PeriodInteract.new '30s'
4
-
5
- mix.on_reply { |bot, post|
6
- bot.reply("Thanks for helping me test stuff :3")
7
- }
8
-
9
- mix.on_fave { |bot, notif|
10
- puts "#{notif.account.acct} just faved post #{notif.status.content}"
11
- }
12
-
13
- mix.on_boost { |bot, notif|
14
- puts "#{notif.account.acct} just boosted post #{notif.status.content}"
15
- }
16
-
17
- mix.run do |bot|
18
- bot.post('testing', visibility: 'direct')
19
- end
data/examples/reply.rb DELETED
@@ -1,7 +0,0 @@
1
- require 'elephrame'
2
-
3
- replier = Elephrame::Bots::Reply.new
4
-
5
- replier.run { |bot|
6
- bot.reply("hey!")
7
- }
@@ -1,38 +0,0 @@
1
- require 'elephrame'
2
- require 'time'
3
-
4
- bot = Elephrame::Bots::TraceryBot.new('1h', 'tracery_files2')
5
-
6
- # this overrides the default behavior for responding to mentions
7
- bot.on_reply do |bot, post|
8
- bot.reply_with_mentions("#greeting#, the current hour is #{Time.now}",
9
- rules: 'reply')
10
- end
11
-
12
- bot.run do |bot|
13
- # get the current hour
14
- hour = Time.now.hour
15
-
16
- case hour
17
-
18
- when (20..23)
19
- when (0..5)
20
- bot.post("The moon is #phase#! It's so spooky :O",
21
- rules: 'moon')
22
-
23
- when (6..9)
24
- bot.post("Gotta get up and #activity#!",
25
- rules: 'morning')
26
-
27
- when (10..16)
28
- bot.post("Can't wait to #activity# when I get home",
29
- rules: 'afternoon')
30
-
31
- when (17..19)
32
- bot.post("Time to start getting ready for #activity#",
33
- rules: 'night')
34
-
35
- else
36
- next
37
- end
38
- end
@@ -1,11 +0,0 @@
1
- {
2
- "origin": "#greeting#, World! I'm #sexuality#!",
3
- "greeting": [ "Hello",
4
- "Greetings",
5
- "Salutations" ],
6
- "sexuality": [ "gay",
7
- "pan",
8
- "bi",
9
- "ace",
10
- "aro"]
11
- }
@@ -1,4 +0,0 @@
1
- {
2
- "default": "#greeting#",
3
- "greeting": ["Salutations", "Hello", "How's it going", "Yo"]
4
- }
@@ -1,3 +0,0 @@
1
- {
2
- "activity": [ "put on PJs", "REET lOUDLY", "pet my cat", "sleeep" ]
3
- }
@@ -1,3 +0,0 @@
1
- {
2
- "phase": [ "waning", "waxing", "new", "full", "half", "gibbous" ]
3
- }
@@ -1,4 +0,0 @@
1
- {
2
- "activity": [ "brush my teeth", "eat breakfast", "get dressed",
3
- "blow up balloons" ]
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "activity": ["bed", "sleeeeeeeeeeeEEEEEP", "curling up",
3
- "building a blanket fort", "playing some videO jaMES"]
4
- }
@@ -1,3 +0,0 @@
1
- {
2
- "greeting": ["Salutations", "Hello", "How's it going", "Yo"]
3
- }
@@ -1,20 +0,0 @@
1
- require 'elephrame'
2
-
3
- # we define our bot by telling elephrame how often it should post,
4
- # and where it should load our tracery rules from
5
- bot = Elephrame::Bots::TraceryBot.new('10s', 'tracery_files')
6
-
7
- # this code happens automatically in the framework
8
- # when there's a rule file for 'reply'
9
- #bot.on_reply do |bot|
10
- # bot.reply_with_mentions("#default#", rules: 'reply')
11
- #end
12
-
13
-
14
- # because there's a tracery file named "default" the framework loads
15
- # it automatically! TraceryBot overloads the default 'post' method
16
- # and makes sure it automatically expands our tracery text using our
17
- # loaded grammar
18
- bot.run do |bot|
19
- bot.post('#greeting#, World! I\'m #sexuality#', visibility: 'unlisted')
20
- end
data/examples/watcher.rb DELETED
@@ -1,14 +0,0 @@
1
- require 'elephrame'
2
-
3
- # here are various examples of how to create a new watcher bot
4
- #tag_watcher = Elephrame::Bots::Watcher.new 'tag', 'CoolHash'
5
- #local_watcher = Elephrame::Bots::Watcher.new 'local'
6
- #ltag_watcher = Elephrame::Bots::Watcher.new 'local hashtag', 'LocalTag'
7
- #list_watcher = Elephrame::Bots::Watcher.new 'list', 'test list'
8
- #home_watcher = Elephrame::Bots::Watcher.new 'home'
9
-
10
- fedi_watcher = Elephrame::Bots::Watcher.new 'public'
11
-
12
- fedi_watcher.run do |bot, post|
13
- puts "#{post.account.acct}: #{post.content}"
14
- end