dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.2.3
britneywright has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch
britneywright has joined #cinch
djbkd has quit [Quit: My people need me...]
jesser_ has joined #cinch
jesser_ has quit [Read error: Connection reset by peer]
jesser_ has joined #cinch
djbkd has joined #cinch
Crisopolis has quit [Ping timeout: 264 seconds]
britneywright has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
djbkd has quit [Remote host closed the connection]
Azure has quit [Ping timeout: 255 seconds]
djbkd has joined #cinch
djbkd has quit [Ping timeout: 246 seconds]
Crisopolis has joined #cinch
frog|OFF is now known as green-big-frog
jesser_ is now known as jesser
postmodern has quit [Quit: Leaving]
Azure has joined #cinch
britneywright has joined #cinch
djbkd has joined #cinch
irsol has quit [Ping timeout: 252 seconds]
djbkd has quit [Ping timeout: 264 seconds]
irsol has joined #cinch
irsol has quit [Ping timeout: 264 seconds]
irsol has joined #cinch
irsol has quit [Ping timeout: 244 seconds]
irsol has joined #cinch
irsol has quit [Ping timeout: 264 seconds]
irsol has joined #cinch
sarkyniin has joined #cinch
<green-big-frog> i need help... I'm trying to find out how I get a Bot to paste the plain text from pure text api... My script: http://hastebin.com/tocacilowu.rb
<green-big-frog> How do I have to do that?
<Gizmokid2005> green-big-frog: you have to read the response from the API and then tell the bot to reply with it.
<green-big-frog> and how do I do that? I have tried diffrent things but I can't find the right way...
<Gizmokid2005> green-big-frog: there's a lot of different ways to do it, you can use this an example, it's my plugin to get weather information from weather underground's api: https://github.com/Gizmokid2005/swissircbot/blob/master/plugins/wunderground.rb
<green-big-frog> butisn't your "example" going to far? All i want to do is get the text from the site (te site is only 3 lines of text, no html, no JSON, or similar) and let the bot post it...
<green-big-frog> @Gizmokid2005
<Gizmokid2005> no green-big-frog
<Gizmokid2005> You need to make a GET request to the site in order to get the content to then display it.
<Gizmokid2005> It would actually be easier if that was a json response.
<green-big-frog> ok
<green-big-frog> and how do I have to do that? I'm trying to learn ruby and so on with cinch, but I'm stuck with this for more than 5 hours...
<Gizmokid2005> green-big-frog: look at examples
<Gizmokid2005> like mine
<Gizmokid2005> you need to get a webpage and parse it with ruby
<Gizmokid2005> using google searches centered around that will help you with most of the code.
<Gizmokid2005> green-big-frog: you may want to look at things like this: https://rubymonk.com/
<green-big-frog> ty
<green-big-frog> Am I right that I need something like nokogiri?
<green-big-frog> @Gizmokid2005
<Gizmokid2005> Likely
<green-big-frog> ohh... I just found out that iheartqoutes has also a json api
<green-big-frog> I am so blind
irsol has quit [Ping timeout: 240 seconds]
<green-big-frog> I did make a little step further... My script: http://hastebin.com/rivesuyoya.rb
<green-big-frog> How do I have to continue?
<green-big-frog> at hastebin.com you can edit posts in the upper right corner
<green-big-frog> @Gizmokid2005 are you there?
<Gizmokid2005> green-big-frog: you've parsed the json. Now you have to tell the reply what part of the json to reply with.
<Gizmokid2005> look at my example again.
<green-big-frog> Gizmokid2005: could you give me your apikey, so that i can better understnad your example?
irsol has joined #cinch
irsol has joined #cinch
<Gizmokid2005> green-big-frog: no. If you follow the way it works, you should be able to adapt yours pretty easy.
<Gizmokid2005> you could even do it in irb instead of inside of cinch
<Gizmokid2005> to work with it realtime
<green-big-frog> irb?
<green-big-frog> ok
<green-big-frog> didn't know about IRB
irsol has quit [Ping timeout: 244 seconds]
irsol has joined #cinch
<green-big-frog> This has to be debugged: http://hastebin.com/seriqonemi.rb
<green-big-frog> Gizmokid2005: thank you for your help!
<green-big-frog> but I can't figure out whats still wrong...
<Gizmokid2005> green-big-frog: where are you getting "data" from?
<Gizmokid2005> data is a variable you don't have.
<Gizmokid2005> you have "parsed"
<green-big-frog> ohh
<Gizmokid2005> Looks like you're getting there though.
<green-big-frog> Gizmokid2005: http://hastebin.com/ofopipikiz.rb
<green-big-frog> I'm to stupid... Could you please help me?
<green-big-frog> Gizmokid2005: are you there?
<Gizmokid2005> green-big-frog: first, you never actually make a web call to get a response for the JSON.
<Gizmokid2005> that's the nokogiri stuff
<Gizmokid2005> second, I think "type" is a reserved word and is probably part of your issue.
<green-big-frog> update: http://hastebin.com/ewafofefud.rb
<green-big-frog> but how do I then have to get the JSONwhen not trough a web call..
<green-big-frog> @Gizmokid2005
<Gizmokid2005> green-big-frog: you aren't currently doing a web call in your code. That's the problem.
<green-big-frog> Gizmokid2005: ok, but that didn't fix anything...
<green-big-frog> the new code: http://hastebin.com/wacojaqeco.rb
<green-big-frog> still not fixed
<Gizmokid2005> green-big-frog: you need to read my example more closely
<Gizmokid2005> pay more attention to the variables you're using.
<Gizmokid2005> line 17 in your code is *definitely* wrong.
<green-big-frog> ok
<green-big-frog> the update: http://hastebin.com/efivabusim.rb
<Gizmokid2005> and?
<green-big-frog> not working
<Gizmokid2005> log?
<green-big-frog> one sec...
<green-big-frog> at the bottom
<green-big-frog> Gizmokid2005: you saw that?
<Gizmokid2005> I'm looking
<green-big-frog> thank you for your help!!!
<Gizmokid2005> green-big-frog: it's because you didn't name your method execute, or tell your match what method to use.
<green-big-frog> that means?
<Gizmokid2005> You either should do match /quote/i, method: :get_quote
<Gizmokid2005> or change def get_quote(m) to get execute(m)
<Gizmokid2005> *def execute(m)
<Gizmokid2005> not get
<Gizmokid2005> also, you're still using "data" but you still haven't declared that variable anywhere.
<green-big-frog> YEAH!!! IT WORKS!!!
<green-big-frog> THANK YOU!!!
<green-big-frog> I MADE MY FIRST PLUGIN WITH AN API!!!
<green-big-frog> Gizmokid2005: thanks for sharing your time and nerves!
<Gizmokid2005> welcome green-big-frog. I would suggest reading up a bit on some ruby tutorials though
<Gizmokid2005> it'll make this stuff a bit easier
<green-big-frog> Yeah...
<Gizmokid2005> you can apply that knowledge to cinch stuff (That's how I've been doing things) but going through some tutorials will help.
iamayam has joined #cinch
<green-big-frog> How can I add more than one formatting Attribut to a post?
<green-big-frog> what I am trying to do and doesn't work: m.reply Format(:bold :black,"test")
<green-big-frog> what works: m.reply Format(:bold,"test")
<dominikh> you're missing a comma.
<green-big-frog> you mean like m.reply Format(:bold,:silver"test")
<green-big-frog> this also doesn't work
<green-big-frog> @dominikh
<leftylink> well obviously it doesn't work
<leftylink> how could :silver "test" work at all
<leftylink> you were told you were missing a comma, not that you moved a comma.
<leftylink> that means gyou shouldn't remove any commas that were already there
<green-big-frog> ahh
<dominikh> I say "you're missing a comma" and you just move the comma around…
<green-big-frog> I got it
<green-big-frog> srr for my dumbness (I'm sick right now)
<green-big-frog> where can I find documentation what else I can put in instead of resp.body?
<green-big-frog> the code part i am looking at: JSON.parse(resp.body)
djbkd has joined #cinch
green-big-frog is now known as frog|OFF
postmodern has joined #cinch
djbkd has quit [Remote host closed the connection]
Rennex has quit [Ping timeout: 240 seconds]
Rennex has joined #cinch
britneywright has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sarkyniin has quit [Remote host closed the connection]
djbkd has joined #cinch
britneywright has joined #cinch
djbkd has quit [Remote host closed the connection]
djbkd has joined #cinch