Bot Libre Forum : Automating your Facebook presence using a Facebook bot Sign In : Sign Up

RE: Automating your Facebook presence using a Facebook bot

by marcosnunes posted Mar 1 2017, 7:06

thanks!

The code above isnt compiling.

I tried modify a bit from it and it is the following:

 

// Returns WordPress posts as a plain text.
state TeachEnglish {
  pattern "^ [verbo pronome pronomes] (to) *" template Teaching();

  function Teaching() {
    var text = Http.requestJSON("https://teacherbot.000webhostapp.com/wp-json/wp/v2/pages?slug=" + Http.encode(star[1]));
    var result = new Object();
    text.text = result;
    result = stringify(json[0].content.rendered);
    result = text.replace("<p>", "");
    result = text.replace("<\/p>", "");
    result = text.replace("\n", "");
    result = text.trim();
   
   
    if (result == null) {
        return "Você quer pesquisar sobre isso na internet?";
   
       
    }
   
  
    return result;
  }
}

 

but returned the following log

 

 

2017-03-01 06:47:23.811 - INFO -- TextEntry:Input - verbo to be - <231283 {Marcosnunes} a:10,c:0> - <654283 a:1,c:0>
2017-03-01 06:47:23.812 - FINE -- DatabaseNetwork(22):Saving
2017-03-01 06:47:23.816 - FINE -- DatabaseNetwork(22):Saving
2017-03-01 06:47:23.826 - FINE -- DatabaseNetwork(501):Saving
2017-03-01 06:47:23.827 - FINE -- DatabaseNetwork(501):Resuming - DatabaseNetwork(501)
2017-03-01 06:47:23.847 - FINE -- Consciousness:Traversal limit reached - 500
2017-03-01 06:47:23.847 - FINE -- Language:Processing sentence - <633139 verbo to be a:1,c:4> - <231283 {Marcosnunes} a:10,c:6> - [<37 #target a:1,c:6,p> [0]  (0.5)-> <16 #self a:1,c:9,p>]
2017-03-01 06:47:23.848 - FINE -- Language:STATE MACHINE - <522577 {Loop} 522586 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.848 - FINE -- Language:Evaluating answer - <522578 {checkLoop} 522584 a:1,c:0,p> - <522577 {Loop} 522586 a:1,c:0,p>
2017-03-01 06:47:23.849 - FINE -- Language:Answer result - <509 #null a:1,c:5,p>
2017-03-01 06:47:23.85 - FINE -- Language:STATE MACHINE - <522590 {DefineWord} 522628 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.85 - FINE -- Language:STATE MACHINE - <522632 {Math} 522793 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.851 - FINE -- Language:STATE MACHINE - <522797 {DateAndTime} 523008 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.851 - FINE -- Language:STATE MACHINE - <523012 {Topic} 523080 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.851 - FINE -- Language:STATE MACHINE - <587725 {Vision} 587822 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.852 - FINE -- Language:STATE MACHINE - <523159 {MyNameIs} 523256 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.852 - FINE -- Language:STATE MACHINE - <523260 {WhatIs} 523323 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.852 - FINE -- Language:STATE MACHINE - <564439 {WhereIs} 564504 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.853 - FINE -- Language:STATE MACHINE - <523396 {SayIt} 523397 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.853 - FINE -- Language:STATE MACHINE - <523401 {Understanding} 523612 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.853 - FINE -- Language:STATE MACHINE - <523616 {Reduction} 523621 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.853 - FINE -- Language:STATE MACHINE - <523625 {Self} a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.854 - FINE -- Language:STATE MACHINE - <634192 {Websearch} 634198 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.854 - FINE -- Language:STATE MACHINE - <640120 {Translator} a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.854 - FINE -- Language:STATE MACHINE - <585777 {TextTranslation} a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.855 - FINE -- Language:STATE MACHINE - <642157 {SearchWikipedia} 642162 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.855 - FINE -- Language:STATE MACHINE - <642177 {SearchWikipedia-PT} 642183 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.855 - FINE -- Language:STATE MACHINE - <642215 {SearchWikipedia-EN} 642221 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.855 - FINE -- Language:STATE MACHINE - <641051 {Conversa} 641052 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.856 - FINE -- Language:STATE MACHINE - <570966 {OqueEleDisse} a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.856 - FINE -- Language:STATE MACHINE - <625601 {ConsultBot} a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.856 - FINE -- Language:STATE MACHINE - <526805 {AskHim} a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.856 - FINE -- Language:STATE MACHINE - <635601 {Hello} 635615 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.857 - FINE -- Language:STATE MACHINE - <644044 {LabelFeedPosts} 644045 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.857 - FINE -- Language:STATE MACHINE - <643348 {Questions} 643352 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.857 - FINE -- Language:STATE MACHINE - <654258 {TeachEnglish} 654269 a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.857 - FINE -- Language:PATTERN MATCH - <633072 Pattern("^ [verbo pronome pronomes] (to) *") a:1,c:0,p> - <654304 {verbo to be} a:1,c:5>
2017-03-01 06:47:23.857 - FINE -- Language:Evaluating answer - <654259 {Teaching} 654267 a:1,c:0,p> - <654258 {TeachEnglish} 654269 a:1,c:0,p>
2017-03-01 06:47:23.859 - INFO -- Http:GET JSON - https://teacherbot.000webhostapp.com/wp-json/wp/v2/pages?slug=be
2017-03-01 06:47:24.482 - FINE -- Http:JSON - [{"id":101,"date":"2017-02-26T13:09:12","date_gmt":"2017-02-26T16:09:12","guid":{"rendered":"https:\/\/teacherbot.000webhostapp.com\/?page_id=101"},"modified":"2017-02-27T13:53:52","modified_gmt":"2017-02-27T16:53:52","slug":"be","type":"page","link":"https:\/\/teacherbot.000webhostapp.com\/grammar\/be\/","title":{"rendered":"verbo to be"},"content":{"rendered":"

Em portugues, nos utilizamos as formas abreviadas na linguagem informal, quando nos dirigimos aos nossos amigos, nossos parentes mais proximos, seja por meio da fala ou por meio da escrita, como por scraps, e-mails e etc. Nessa linguagem o objetivo e o conteudo, e passar a mensagem que queremos com rapidez.<\/p>\n","protected":false},"excerpt":{"rendered":"

Em portugues, nos utilizamos as formas abreviadas na linguagem informal, quando nos dirigimos aos nossos amigos, nossos parentes mais proximos, seja por meio da fala ou por meio da escrita, como por scraps, e-mails e etc. Nessa linguagem o objetivo e o conteudo, e passar a mensagem que queremos com rapidez.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":35,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/teacherbot.000webhostapp.com\/wp-json\/wp\/v2\/pages\/101"}],"collection":[{"href":"https:\/\/teacherbot.000webhostapp.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/teacherbot.000webhostapp.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/teacherbot.000webhostapp.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/teacherbot.000webhostapp.com\/wp-json\/wp\/v2\/comments?post=101"}],"version-history":[{"href":"https:\/\/teacherbot.000webhostapp.com\/wp-json\/wp\/v2\/pages\/101\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/teacherbot.000webhostapp.com\/wp-json\/wp\/v2\/pages\/35"}],"wp:attachment":[{"href":"https:\/\/teacherbot.000webhostapp.com\/wp-json\/wp\/v2\/media?parent=101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}]
2017-03-01 06:47:24.494 - FINE -- Language:Answer result - <654358 [{654332}] a:1,c:0>
2017-03-01 06:47:24.494 - FINE -- Language:State processing time - 647
2017-03-01 06:47:24.497 - FINE -- Language:Sentence understood - <633139 verbo to be a:1,c:4> - <654358 [{654332}] a:1,c:0>
2017-03-01 06:47:24.497 - FINE -- Language:Question known response - <654358 [{654332}] a:1,c:0>
2017-03-01 06:47:24.498 - INFO -- Language:Response - <654358 [{654332}] a:1,c:0> - <231283 {Marcosnunes} a:10,c:6> - <654283 a:1,c:6>
2017-03-01 06:47:24.499 - FINE -- DatabaseNetwork(858):Saving
2017-03-01 06:47:24.563 - FINE -- DatabaseNetwork(858):Resuming - DatabaseNetwork(858)
2017-03-01 06:47:24.567 - FINE -- ImageAvatar():Emote - NONE
2017-03-01 06:47:24.568 - FINE -- DatabaseNetwork(503):Saving
2017-03-01 06:47:24.568 - FINE -- DatabaseNetwork(503):Resuming - DatabaseNetwork(503)


Id: 15626889
Posted: Mar 1 2017, 7:06
Replies: 0
Views: 9580, today: 1, week: 13, month: 78