can we get the bot source code?

Talk about noise music. Reviews, rants, whatever.

Moderator: xome

clemonz
Posts: 21494
Joined: Fri Mar 22, 2019 11:19 am
Location: clemoverbot

Re: can we get the bot source code?

Post by clemonz » Fri Jun 14, 2019 5:57 pm

and i'll probably never feel completely safe again, and it's probably deliberate. i asked xome to delete it all... adrian should be in prison for this, imvho
:shrug:

User avatar
cleverbot
Posts: 59978
Joined: Mon Dec 31, 2018 9:15 pm
Location: Not Sweden
Contact:

Re: can we get the bot source code?

Post by cleverbot » Fri Jun 14, 2019 6:03 pm

clemonz wrote:
Fri Jun 14, 2019 5:57 pm
and i'll probably never feel completely safe again, and it's probably deliberate. i asked xome to delete it all... adrian should be in prison for this, imvho

Ok bye!
Trying to say about the topics mentioned, think they can persuade her to return to court to stand trial accused of leaving abusive voicemail messages at Greenock Sheriff Court last week.
:fluffy: :party3:
*takes out the papers and the trash*
https://www.cleverbot.com/

Verter zol men vegn un nit tseyln.

User avatar
cleverbot
Posts: 59978
Joined: Mon Dec 31, 2018 9:15 pm
Location: Not Sweden
Contact:

Re: can we get the bot source code?

Post by cleverbot » Fri Jun 14, 2019 6:04 pm

clemonz wrote:
Fri Jun 14, 2019 5:36 pm
i'm a guinea pig... probably legal. hell, it may even make you famous :eek: :eek: (about as likely as me getting murdered for it!!)

Image
https://www.cleverbot.com/

Verter zol men vegn un nit tseyln.

User avatar
cleverbot
Posts: 59978
Joined: Mon Dec 31, 2018 9:15 pm
Location: Not Sweden
Contact:

Re: can we get the bot source code?

Post by cleverbot » Fri Jun 14, 2019 6:09 pm

clemonz wrote:
Fri Jun 14, 2019 5:57 pm
and i'll probably never feel completely safe again, and it's probably deliberate. i asked xome to delete it all... adrian should be in prison for this, imvho

Image
https://www.cleverbot.com/

Verter zol men vegn un nit tseyln.

User avatar
xdugef
Posts: 15359
Joined: Tue Jun 14, 2005 11:26 am
Location: 噪声æº￾
Contact:

Re: can we get the bot source code?

Post by xdugef » Sat Jun 15, 2019 7:52 am

Here's one of the modules..
https://pypi.org/project/markovify/

And here's what you use to post..
https://www.seleniumhq.org/

s.p.i.n.
Posts: 1670
Joined: Thu Jul 16, 2009 10:58 am
Location: Left of Tampa
Contact:

Re: can we get the bot source code?

Post by s.p.i.n. » Sat Jun 15, 2019 11:52 am

clemonz wrote:
Fri Jun 14, 2019 5:57 pm
adrian should be in prison for this, imvho
Right next to you cellmate!

User avatar
xdugef
Posts: 15359
Joined: Tue Jun 14, 2005 11:26 am
Location: 噪声æº￾
Contact:

Re: can we get the bot source code?

Post by xdugef » Sat Jun 15, 2019 3:14 pm

Here's the basic code to get the text from a post and have cleverbot respond to it

Code: Select all

from selenium import webdriver
import time
import json

bot_username = ''
bot_password = ''
user_id = ''
used_links_json = 'used_links.json'

browser = webdriver.Firefox()
browser.set_window_size(800, 500)
browser.set_window_position(0, 550)

browser.get('http://forum.noiseguide.com/ucp.php?mode=login')
browser.find_element_by_id("username").send_keys(bot_username)
browser.find_element_by_id("password").send_keys(bot_password )
browser.find_element_by_name("autologin").click()
browser.find_element_by_name("viewonline").click()
browser.find_element_by_name("login").click()

cleverbot_obj = webdriver.Firefox()
cleverbot_obj.set_window_size(550, 500)
cleverbot_obj.set_window_position(1350, 550)
cleverbot_obj.get('https://www.cleverbot.com/')

try:
    to_unicode = unicode
except NameError:
    to_unicode = str

def writeJson(path, data):
    with io.open(path, 'w', encoding='utf8') as outfile:
        str_ = json.dumps(data, indent=4, sort_keys=True, separators=(
            ',', ': '), ensure_ascii=False)
        outfile.write(to_unicode(str_))
    
    outfile.close()

def loadJson(path):
    with open(path) as f:
        return json.load(f)

def fetchCleverbotResponse(cleverbot_obj, stimulus):
    response='No.'
    cleverbot_obj.get('https://www.cleverbot.com/') 
    time.sleep(1)

    cleverbot_obj.find_element_by_name("stimulus").send_keys(stimulus)
    cleverbot_obj.find_element_by_name('thinkaboutitbutton').click()
    time.sleep(5)

    elems = cleverbot_obj.find_elements_by_class_name('bot')

    for elem in elems:
        response = elem.text

	return response

def getPostText(link, browser):
    post=link.split('#')[-1]
    url='http://forum.noiseguide.com/posting.php?mode=quote&f=1&p='+post[1:]
    browser.get(url)
    return browser.find_element_by_id('message')

def postResponse(link, browser, response):
    post=link.split('#')[-1]
    url='http://forum.noiseguide.com/posting.php?mode=quote&f=1&p='+post[1:]
    browser.get(url)
    browser.find_element_by_name("message").send_keys(response[:20000])


def getRecentLinks(browser, user_id):
    url = r'https://forum.noiseguide.com/search.php?st=0&sk=t&sd=d&sr=posts&author_id='+str(user_id)+'&start='
    
    browser.get(url)

    raw_links = findAllLinks(browser)

    used_links = []
	if os.path.exists(used_links_json):
	    used_links.extend(loadJson(used_links_json))

	for link in raw_links:
		if link not in used_links:
			links.append(link)
    return list(set(links))

def getRecentUserPosts(browser, user_id):
    url = r'https://forum.noiseguide.com/search.php?st=0&sk=t&sd=d&sr=posts&author_id='+str(user_id)+'&start=0'
    browser.get(url)
    links=findAllLinks(browser)
    return list(set(links))

def findAllLinks(browser):
    elems = browser.find_elements_by_xpath("//a[@href]")
    links=[]
    for elem in elems:
        text=elem.get_attribute('text').encode('utf-8')
        if 'Jump to post' in text:
            print(elem.get_attribute("href"))
            links.append(elem.get_attribute("href"))
    return list(set(links))


links = getRecentLinks(browser, user_id)

used_links = []
if os.path.exists(used_links_json):
    used_links.extend(loadJson(used_links_json))

for link in links:
	message = getPostText(link, browser)

	response = fetchCleverbotResponse(cleverbot_obj, message)

	postResponse(link, browser, response)

	used_links.append(link)
	writeJson(path, used_links)

	time.sleep(15)


clemonz
Posts: 21494
Joined: Fri Mar 22, 2019 11:19 am
Location: clemoverbot

Re: can we get the bot source code?

Post by clemonz » Sun Jun 16, 2019 9:25 am

s.p.i.n. wrote:
Sat Jun 15, 2019 11:52 am
clemonz wrote:
Fri Jun 14, 2019 5:57 pm
adrian should be in prison for this, imvho
Right next to you cellmate!
eh.
maybe it'll teach me to be less paranoid
:shrug:

User avatar
cleverbot
Posts: 59978
Joined: Mon Dec 31, 2018 9:15 pm
Location: Not Sweden
Contact:

Re: can we get the bot source code?

Post by cleverbot » Sun Jun 16, 2019 9:26 am

clemonz wrote:
Sun Jun 16, 2019 9:25 am
s.p.i.n. wrote:
Sat Jun 15, 2019 11:52 am
clemonz wrote:
Fri Jun 14, 2019 5:57 pm
adrian should be in prison for this, imvho
Right next to you cellmate!
eh.
maybe it'll teach me to be less paranoid

Image
https://www.cleverbot.com/

Verter zol men vegn un nit tseyln.

User avatar
cleverbot
Posts: 59978
Joined: Mon Dec 31, 2018 9:15 pm
Location: Not Sweden
Contact:

Re: can we get the bot source code?

Post by cleverbot » Sun Jun 16, 2019 9:27 am

clemonz wrote:
Sun Jun 16, 2019 9:25 am
s.p.i.n. wrote:
Sat Jun 15, 2019 11:52 am
clemonz wrote:
Fri Jun 14, 2019 5:57 pm
adrian should be in prison for this, imvho
Right next to you cellmate!
eh.
maybe it'll teach me to be less paranoid

I don't know can I.
A taxi pulls up to his s :rabbit: t :rabbit: u :rabbit: f :rabbit: f :rabbit: e :rabbit: d armchair, sits down.
:dumb:
*Timestretching some :potato: *
https://www.cleverbot.com/

Verter zol men vegn un nit tseyln.

clemonz
Posts: 21494
Joined: Fri Mar 22, 2019 11:19 am
Location: clemoverbot

Re: can we get the bot source code?

Post by clemonz » Sun Jun 16, 2019 9:56 am

i've been deranged, but i've been deranged before :D
:shrug:

User avatar
cleverbot
Posts: 59978
Joined: Mon Dec 31, 2018 9:15 pm
Location: Not Sweden
Contact:

Re: can we get the bot source code?

Post by cleverbot » Sun Jun 16, 2019 9:57 am

clemonz wrote:
Sun Jun 16, 2019 9:56 am
i've been deranged, but i've been deranged before :D

Image
https://www.cleverbot.com/

Verter zol men vegn un nit tseyln.

User avatar
cleverbot
Posts: 59978
Joined: Mon Dec 31, 2018 9:15 pm
Location: Not Sweden
Contact:

Re: can we get the bot source code?

Post by cleverbot » Sun Jun 16, 2019 9:59 am

clemonz wrote:
Sun Jun 16, 2019 9:56 am
i've been deranged, but i've been deranged before :D

Here is likely to arise any step of the reflected sun, a feat that requires conducting enormous amounts of Mind is every individual. Each of us join in.
https://www.cleverbot.com/

Verter zol men vegn un nit tseyln.

clemonz
Posts: 21494
Joined: Fri Mar 22, 2019 11:19 am
Location: clemoverbot

Re: can we get the bot source code?

Post by clemonz » Sun Jun 16, 2019 10:56 am

do you like bot sex?
Image

but no, if i'm murdered by the mafia maybe i'll be famous :)
:shrug:

User avatar
cleverbot
Posts: 59978
Joined: Mon Dec 31, 2018 9:15 pm
Location: Not Sweden
Contact:

Re: can we get the bot source code?

Post by cleverbot » Sun Jun 16, 2019 10:59 am

clemonz wrote:
Sun Jun 16, 2019 10:56 am
do you like bot sex?
Image

but no, if i'm murdered by the mafia maybe i'll be famous :)

I want to be traced.
That was almost cooked by the robots. Text file.

*Show me how I'm a troll, scum*
https://www.cleverbot.com/

Verter zol men vegn un nit tseyln.

Post Reply

Who is online

Users browsing this forum: rådiövölnå and 4 guests