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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/elephrame.gemspec +2 -2
- data/lib/elephrame/version.rb +1 -1
- metadata +2 -23
- data/examples/README.md +0 -5
- data/examples/command.rb +0 -28
- data/examples/ebooks.rb +0 -24
- data/examples/getting_started.org +0 -484
- data/examples/interact.rb +0 -22
- data/examples/markov.rb +0 -20
- data/examples/markov_files/manifesto.txt +0 -1886
- data/examples/notbot_check.rb +0 -14
- data/examples/periodic.rb +0 -7
- data/examples/periodic_interact.rb +0 -19
- data/examples/reply.rb +0 -7
- data/examples/tracery_adv.rb +0 -38
- data/examples/tracery_files/default.json +0 -11
- data/examples/tracery_files/reply.json +0 -4
- data/examples/tracery_files2/afternoon.json +0 -3
- data/examples/tracery_files2/moon.json +0 -3
- data/examples/tracery_files2/morning.json +0 -4
- data/examples/tracery_files2/night.json +0 -4
- data/examples/tracery_files2/reply.json +0 -3
- data/examples/tracery_simple.rb +0 -20
- data/examples/watcher.rb +0 -14
data/examples/notbot_check.rb
DELETED
|
@@ -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,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
data/examples/tracery_adv.rb
DELETED
|
@@ -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
|
data/examples/tracery_simple.rb
DELETED
|
@@ -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
|