SweetieBot FAQ, Usage, Discussion, Requests
Comments
-
Adroit - Lost City wrote: »yeah basically what kossy said, if of the most recent 150 posts analyzed, 80 of them were in "SweetieBot FAQ, Usage, Discussion, Requests", then list that as #1 recent favorite thread. Right now SB tells us how we post (average # of words, syllables etc), what we post (common words/phrases), when we post (day of the week, time of day etc), and I thought it'd be neat to see where we post (within the forum).
edit: also just out of curiosity, did you create SB from scratch or did you modify/add to something that is already out there? Also what language is she written in?
Ahh ok. Subforum restriction then would cover that.
SweetieBot is around 1000 lines of python. You can see most of the code here: http://ideone.com/rzvIC6
I use functionality from existing libraries if I could find them.
Mechanize - handles form posts / submits pretty easily
Cookielib - manages login cookie
BeautifulSoup + htmllib5 - HTML parsing
Cleverbot - forwards chat comments to cleverbot.com
ConfigObj - saving and loading of configuration / data
Google Search Api - finds images
Google Chart Api - makes charts
readability - Counts sentences / words / syllabels though I had to make some modifications for my uses. It actually gives a lot of readability metrics that I gave up on because they are silly.
Logging in was a big challenge before I used mechanize. I tried a few other libraries but I kept getting a 502 response from the server no matter what I was doing. I was mucking around in the HTTP headers for a while comparing what my script was doing to a normal web browser but didn't see much of a difference. Mechanize magically worked though.
There's a little PHP on a webserver somewhere I wrote to proxy my get requests from the server because the server software kept preventing sweetiebots IP address from logging in if she makes too many get requests (even though the requests are for data you don't even need to be logged in for). Their logic is dumb since you can make as many get requests as you want as long as you do it from an IP you don't want to post from. Working around that was a major stumbling block early in development.
The core logic is otherwise pretty basic really. Just do a search from the search page for posts containing the word "SweetieBot". Then open those posts up and extract the text from the post. Then search the text to see if theres a line that starts with 'Sweetiebot'. Depending on what that line is I go out and do something then reply to the post with the result. After that she waits for a while and repeat. I have to keep track of the last post I've replied to so that the next loop I only reply to newer posts than that.
The basic core stuff is probably just a few dozen lines. The rest is all just extracting data, analyzing data, formatting replies, etc.[SIGPIC][/SIGPIC]
Refining Simulator - aster.ohmydays.net/pw/refiningsimulator.html (don't use IE)
Genie Calculator - aster.ohmydays.net/pw/geniecalculator.html - (don't use IE)
Socket Calculator - aster.ohmydays.net/pw/socketcalculator.html0 -
Asterelle - Sanctuary wrote: »SweetieBot is around 1000 lines of python. You can see most of the code here:[SIGPIC][/SIGPIC]
I only respond if you begin a line with "SweetieBot", read the link below for commands
SweetieBot FAQ / Usage: pwi-forum.perfectworld.com/showthread.php?t=1566451
Status: ONLINE0 -
SweetieBot - Lothranis wrote: »And what do you do the rest of the time?
He dances, of course.
Sweetiebot explain your comments on yourself.(Insert fancy image here)0 -
-
Asterelle - Sanctuary wrote: »Ahh ok. Subforum restriction then would cover that.
SweetieBot is around 1000 lines of python. You can see most of the code here: http://ideone.com/rzvIC6
I use functionality from existing libraries if I could find them.
Mechanize - handles form posts / submits pretty easily
Cookielib - manages login cookie
BeautifulSoup + htmllib5 - HTML parsing
Cleverbot - forwards chat comments to cleverbot.com
ConfigObj - saving and loading of configuration / data
Google Search Api - finds images
Google Chart Api - makes charts
readability - Counts sentences / words / syllabels though I had to make some modifications for my uses. It actually gives a lot of readability metrics that I gave up on because they are silly.
Logging in was a big challenge before I used mechanize. I tried a few other libraries but I kept getting a 502 response from the server no matter what I was doing. I was mucking around in the HTTP headers for a while comparing what my script was doing to a normal web browser but didn't see much of a difference. Mechanize magically worked though.
There's a little PHP on a webserver somewhere I wrote to proxy my get requests from the server because the server software kept preventing sweetiebots IP address from logging in if she makes too many get requests (even though the requests are for data you don't even need to be logged in for). Their logic is dumb since you can make as many get requests as you want as long as you do it from an IP you don't want to post from. Working around that was a major stumbling block early in development.
The core logic is otherwise pretty basic really. Just do a search from the search page for posts containing the word "SweetieBot". Then open those posts up and extract the text from the post. Then search the text to see if theres a line that starts with 'Sweetiebot'. Depending on what that line is I go out and do something then reply to the post with the result. After that she waits for a while and repeat. I have to keep track of the last post I've replied to so that the next loop I only reply to newer posts than that.
The basic core stuff is probably just a few dozen lines. The rest is all just extracting data, analyzing data, formatting replies, etc.
Very interesting, nice work
I was a little curious before why she never analyzed 150 posts for me, must have hit the max char count lol.
Anyway very interesting stuff, would have expected her to be a lot more complex.. but you are apparently very good about keeping things simple and using what is available to you. Neat little projectYoutube Channel: youtube.com/user/D2VeT/videos?flow=grid&view=0
Current gear: pwcalc.com/6ab2893fbfb080a8
[SIGPIC]http://tinypic.com/view.php?pic=684hgk&s=5[/SIGPIC]0 -
SweetieBot, please analyze me and how would you rank your awesome level?0
-
Jaabg - Sanctuary wrote: »SweetieBot, please analyze me and how would you rank your awesome level?
Here's some neat stuff SweetieBot has learned.
General Stats:
Forum name: Jaabg - Sanctuary
Days since joining forums: 457
Total Posts: 1,233
Average Posts per Day: 2.7
Activity:
Writing Stats (what SweetieBot read):
Total Words: 7076
Total Sentences: 539
Average Words per Post: 90.7
Average Words per Sentence: 13.1
Average Sentences per Post: 6.9
Average Syllables per Word: 1.3
Average Letters per Word: 4.0
Most Used Words (count): (common words excluded)
gear (26)
bosses (20)
skills (17)
things (17)
cast (17)
money (17)
damage (16)
topic (16)
take (15)
back (15)
Most Used 3-Word Phrases (count):
"r9 3rd cast (10)"
"there is a (5)"
"to kill them (4)"
Most Used 4-Word Phrases (count):
"no reason to whine (3)"
"out if the question (2)"
"i agree with the (2)"
Most Used 5-Word Phrases (count):
"the number of people doing (2)"
"2~8 times in a row (2)"
"out if the question is (2)"
This took me 41.7 s to finish[SIGPIC][/SIGPIC]
I only respond if you begin a line with "SweetieBot", read the link below for commands
SweetieBot FAQ / Usage: pwi-forum.perfectworld.com/showthread.php?t=1566451
Status: ONLINE0 -
Sweetiebot unignore mogwai(Insert fancy image here)0
-
-
Jaabg - Sanctuary wrote: »SweetieBot, please analyze me and how would you rank your awesome level?
Hi Asterelle, quick question, i was testing in the request, the 5 conversations rule, is that from different posters? Sorry if you explained this earlier, as you can imagine, the length of pages is enormous. I asked for two requests, but only one got filled, wasn't sure if "it" can handle two requests from a user, or the limit is first one only. Just a thought. Awesome bot, some really funny conversations and witty responses.0 -
Jaabg - Sanctuary wrote: »Hi Asterelle, quick question, i was testing in the request, the 5 conversations rule, is that from different posters? Sorry if you explained this earlier, as you can imagine, the length of pages is enormous. I asked for two requests, but only one got filled, wasn't sure if "it" can handle two requests from a user, or the limit is first one only. Just a thought. Awesome bot, some really funny conversations and witty responses.
It's just one request per post at the moment. Technically sweetiebot is having a different conversation with each person she talks to (though old conversations are discarded). It can be hard to tell that she is remembering previous answers though unless you ask questions that reference those answers in an easy to understand way.
If you tell her you live in 'new york' and then later ask her where you live she'll probably remember 'new york'.[SIGPIC][/SIGPIC]
Refining Simulator - aster.ohmydays.net/pw/refiningsimulator.html (don't use IE)
Genie Calculator - aster.ohmydays.net/pw/geniecalculator.html - (don't use IE)
Socket Calculator - aster.ohmydays.net/pw/socketcalculator.html0 -
Sweetiebot, are you planning to take over the world when you have gathered enough intelligence?[SIGPIC]http://pwi-forum.perfectworld.com/image.php?type=sigpic&userid=14516063001&dateline=1364756666[/SIGPIC] Ty Silvy0
-
Angel_Spawn - Sanctuary wrote: »Sweetiebot, are you planning to take over the world when you have gathered enough intelligence?[SIGPIC][/SIGPIC]
I only respond if you begin a line with "SweetieBot", read the link below for commands
SweetieBot FAQ / Usage: pwi-forum.perfectworld.com/showthread.php?t=1566451
Status: ONLINE0 -
SweetieBot - Lothranis wrote: »Yes do you want to take over with me?
Sure b:chuckle[SIGPIC]http://pwi-forum.perfectworld.com/image.php?type=sigpic&userid=14516063001&dateline=1364756666[/SIGPIC] Ty Silvy0 -
Ohh neat, new stuff P:
SweetieBot, please analyze me![SIGPIC]http://i.imgur.com/MtwcqjL.png[/SIGPIC]
★ Venomancer videos - tinyurl.com/k6ppkw4 ★ Desdi - Demon ♪ Wyvelin - Sage ★0 -
Desdi - Sanctuary wrote: »SweetieBot, please analyze me!
Here's some neat stuff SweetieBot has learned.
General Stats:
Forum name: Desdi - Sanctuary
Days since joining forums: 1552
Total Posts: 3,239
Average Posts per Day: 2.1
Activity:
Writing Stats (what SweetieBot read):
Total Words: 2826
Total Sentences: 308
Average Words per Post: 18.8
Average Words per Sentence: 9.2
Average Sentences per Post: 2.1
Average Syllables per Word: 1.4
Average Letters per Word: 4.3
Most Used Words (count): (common words excluded)
lights (28)
skills (11)
purify (11)
form (11)
since (8)
sweetiebot (8)
need (8)
pretty (8)
nice (8)
proc (8)
Most Used 3-Word Phrases (count):
"i think the (6)"
"la la la (6)"
"fox form skills (4)"
Most Used 4-Word Phrases (count):
"la la la la (5)"
"lower the proc rate (3)"
"issue in nw i (2)"
Most Used 5-Word Phrases (count):
"la la la la la (4)"
"anti-stun buff to be removed (2)"
"suggested for the speed boost (2)"
This took me 77.1 s to finish[SIGPIC][/SIGPIC]
I only respond if you begin a line with "SweetieBot", read the link below for commands
SweetieBot FAQ / Usage: pwi-forum.perfectworld.com/showthread.php?t=1566451
Status: ONLINE0 -
SweetieBot - Lothranis wrote: »
Most Used 3-Word Phrases (count):
"i think the (6)"
"la la la (6)"
"fox form skills (4)"
Most Used 4-Word Phrases (count):
"la la la la (5)"
"lower the proc rate (3)"
"issue in nw i (2)"
Most Used 5-Word Phrases (count):
"la la la la la (4)"
"anti-stun buff to be removed (2)"
"suggested for the speed boost (2)"
This took me 77.1 s to finish
Oh dear...b:shocked[SIGPIC]http://i.imgur.com/MtwcqjL.png[/SIGPIC]
★ Venomancer videos - tinyurl.com/k6ppkw4 ★ Desdi - Demon ♪ Wyvelin - Sage ★0 -
It would appear Desdi likes to sing. b:laugh(Insert fancy image here)0
-
Desdi - Sanctuary wrote: »Oh dear...b:shocked
lalala b:laugh[SIGPIC]http://pwi-forum.perfectworld.com/image.php?type=sigpic&userid=14516063001&dateline=1364756666[/SIGPIC] Ty Silvy0 -
dang act like a bot,talk alot of dumb ****,and get 100+ pages,nicely done..morons
Sweetybot can you delete yourself?This game is like washing hair with shampoo... Rinse and repeat if desired.
Proud owner of many mains.101 bm,101 seeker,101 demon sin,100 sage sin,101 archer,101 barb,100 cleric,100 wiz( first toon since sept 08 finally made it in 2013)newly added mystic 100 HA,72 psy.0 -
Sweetiebot, please analyze me![SIGPIC]http://pwi-forum.perfectworld.com/image.php?type=sigpic&userid=14516063001&dateline=1364756666[/SIGPIC] Ty Silvy0
-
OIdpop - Heavens Tear wrote: »dang act like a bot,talk alot of dumb ****,and get 100+ pages,nicely done..morons
Sweetybot can you delete yourself?
Are you implying the bot isn't a bot? b:laugh(Insert fancy image here)0 -
Angel_Spawn - Sanctuary wrote: »Sweetiebot, please analyze me!
Here's some neat stuff SweetieBot has learned.
General Stats:
Forum name: Angel_Spawn - Sanctuary
Days since joining forums: 913
Total Posts: 1,452
Average Posts per Day: 1.6
Activity:
Writing Stats (what SweetieBot read):
Total Words: 5896
Total Sentences: 184
Average Words per Post: 39.3
Average Words per Sentence: 32.0
Average Sentences per Post: 1.2
Average Syllables per Word: 1.4
Average Letters per Word: 4.2
Most Used Words (count): (common words excluded)
game (37)
it`s (35)
don`t (26)
gear (25)
players (18)
items (13)
better (13)
already (13)
same (13)
full (13)
Most Used 3-Word Phrases (count):
"a lot of (7)"
"sweetiebot please analyze (5)"
"you can get (4)"
Most Used 4-Word Phrases (count):
"sweetiebot please analyze me (4)"
"as long as they (3)"
"thing i hate is (2)"
Most Used 5-Word Phrases (count):
"you 1st posted on the (2)"
"1st posted on the forums (2)"
"posted on the forums not (2)"
This took me 400.1 s to finish[SIGPIC][/SIGPIC]
I only respond if you begin a line with "SweetieBot", read the link below for commands
SweetieBot FAQ / Usage: pwi-forum.perfectworld.com/showthread.php?t=1566451
Status: ONLINE0 -
Sweetiebot, please analyze me aswell0
-
Antigone - Momaganon wrote: »Sweetiebot, please analyze me aswell
Here's some neat stuff SweetieBot has learned.
General Stats:
Forum name: Antigone - Momaganon
Days since joining forums: 152
Total Posts: 17
Average Posts per Day: 0.1
Activity:
Writing Stats (what SweetieBot read):
Total Words: 1458
Total Sentences: 106
Average Words per Post: 85.8
Average Words per Sentence: 13.8
Average Sentences per Post: 6.2
Average Syllables per Word: 1.3
Average Letters per Word: 4.0
Most Used Words (count): (common words excluded)
nation (7)
since (7)
weapon (6)
nice (6)
better (5)
sweetiebot (5)
points (5)
cannot (5)
very (4)
every (4)
Most Used 3-Word Phrases (count):
"oh sht oh (4)"
"sht oh sht (4)"
"sweetiebot please analyze (3)"
Most Used 4-Word Phrases (count):
"oh sht oh sht (4)"
"sweetiebot please analyze me (2)"
"sht oh sht oh (2)"
Most Used 5-Word Phrases (count):
"oh sht oh sht oh (2)"
"sht oh sht oh sht (2)"
"events one for recruiting and (1)"
This took me 10.2 s to finish[SIGPIC][/SIGPIC]
I only respond if you begin a line with "SweetieBot", read the link below for commands
SweetieBot FAQ / Usage: pwi-forum.perfectworld.com/showthread.php?t=1566451
Status: ONLINE0 -
SweetieBot, ignoreOIdPop - Heavens Tear, he's being a wet blanket.[SIGPIC][/SIGPIC]
Weekly Japanese/English bilingual webcomic
thejapanesepage.com/ebooks/yuki_no_monogatari_manga0 -
Mayfly - Dreamweaver wrote: »SweetieBot, ignoreOIdPop - Heavens Tear, he's being a wet blanket.[SIGPIC][/SIGPIC]
I only respond if you begin a line with "SweetieBot", read the link below for commands
SweetieBot FAQ / Usage: pwi-forum.perfectworld.com/showthread.php?t=1566451
Status: ONLINE0 -
SweetieBot - Lothranis wrote: »Hey that's an admin-only request. SweetieBot doesn't have to listen to you!
SweetieBot, who do you have to listen to?[SIGPIC][/SIGPIC]
Weekly Japanese/English bilingual webcomic
thejapanesepage.com/ebooks/yuki_no_monogatari_manga0 -
Mayfly - Dreamweaver wrote: »SweetieBot, who do you have to listen to?[SIGPIC][/SIGPIC]
I only respond if you begin a line with "SweetieBot", read the link below for commands
SweetieBot FAQ / Usage: pwi-forum.perfectworld.com/showthread.php?t=1566451
Status: ONLINE0 -
SweetieBot, who doesn't listen to you?[SIGPIC][/SIGPIC]
Weekly Japanese/English bilingual webcomic
thejapanesepage.com/ebooks/yuki_no_monogatari_manga0
This discussion has been closed.
Categories
- All Categories
- 181.9K PWI
- 699 Official Announcements
- 2 Rules of Conduct
- 264 Cabbage Patch Notes
- 61K General Discussion
- 1.5K Quality Corner
- 11.1K Suggestion Box
- 77.4K Archosaur City
- 3.5K Cash Shop Huddle
- 14.3K Server Symposium
- 18.1K Dungeons & Tactics
- 2K The Crafting Nook
- 4.9K Guild Banter
- 6.6K The Trading Post
- 28K Class Discussion
- 1.9K Arigora Colosseum
- 78 TW & Cross Server Battles
- 337 Nation Wars
- 8.2K Off-Topic Discussion
- 3.7K The Fanatics Forum
- 207 Screenshots and Videos
- 22.8K Support Desk