dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.0.11
ckrailo has left #cinch [#cinch]
[krisbulman] is now known as krisbulman
krisbulman is now known as [krisbulman]
[krisbulman] is now known as krisbulman
krisbulman is now known as [krisbulman]
[krisbulman] is now known as krisbulman
krisbulman is now known as [krisbulman]
Azure has quit [Quit: Textual IRC Client: www.textualapp.com]
Azure has joined #cinch
v0n has joined #cinch
v0n has quit [Ping timeout: 272 seconds]
somasonic has quit [Changing host]
somasonic has joined #cinch
Namaste has joined #cinch
Namaste is now known as CM-Punk
<CM-Punk> Would any of you know why this: http://pastebin.com/WuUX65vf is returning a result of: [00:54:25] <@Eve> - -
<onewheelskyward> %Q{
<onewheelskyward> #{data.title} - #{data.content} - #{data.url} }
<onewheelskyward> data is empty
<CM-Punk> I don't understan
<CM-Punk> onewheelskyward, how is it empty?
<CM-Punk> Not saying you're wrong, but I'm at a loss on how to get it to work
<onewheelskyward> Have a visual debugger handy?
<onewheelskyward> I'd bet money that data.title, content and url are all blank
<CM-Punk> No, I don't...
<onewheelskyward> try a puts on them where the %Q happens.
<onewheelskyward> puts data.inspect
<CM-Punk> onewheelskyward
<CM-Punk> It says nil
<CM-Punk> But I don't understand why it's nil
<CM-Punk> I mean, it's obviously not returning anything due to the blank spaces, but why?
<onewheelskyward> Because whatever populates it isn't doing what you think it is.
<onewheelskyward> Also, your search_results function is inside your search function
<CM-Punk> Inside?
Azure has quit [Read error: Connection reset by peer]
Azure has joined #cinch
<onewheelskyward> yeah, within the begin/end block
<CM-Punk> Still getting the same results, which is nothing
<ayonix> you can rescue without a begin?
<ayonix> also, check if it throws an exception and thus returning nil
<ayonix> and you should check / transform terms to be a correct part of an uri
<ayonix> if someone enters spaces for example it will throw an exception
CM-Punk has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<ayonix> and your code to create an openstruct fails as well
<ayonix> results is an array of hashes, so it can't generate one open struct out of it
<ayonix> you had to either pick one result or iterate over all of them
<ayonix> do you know there are REPLs like irb?
<ayonix> it helps a lot to try things if you don't know what's going on..
<ayonix> oh, your s_results should probably be data['responseData']['results'], there's the array with the found results...
kludge` has quit [Ping timeout: 260 seconds]
kludge` has joined #cinch
thews has quit []
postmodern has quit [Quit: Leaving]
v0n has joined #cinch
kith has quit [Read error: Connection reset by peer]
kith has joined #cinch
UberDragon has quit [Quit: UberDragon]
v0n has quit [Ping timeout: 248 seconds]
v0n has joined #cinch
ayonix has quit [Read error: Connection reset by peer]
ayonix has joined #cinch
literal has quit [Ping timeout: 252 seconds]
literal has joined #cinch
UberDragon has joined #cinch
Spami has joined #cinch
[krisbulman] is now known as krisbulman
krisbulman is now known as krisbulman|oOo
Spami has quit [Quit: This computer has gone to sleep]
krisbulman|oOo is now known as [krisbulman|oOo]
Azure has quit [Ping timeout: 260 seconds]
Azure has joined #cinch
skybotalpha has quit [Ping timeout: 252 seconds]
v0n has quit [Read error: Operation timed out]
onewheelskyward has quit [Ping timeout: 245 seconds]
dpg has joined #cinch
CM-Punk has joined #cinch
<dpg> is there anyway to get a @<variable> inside of the Bot.new instantiation?
<dominikh> what do you need that for?
<dpg> so I'm making the bot post to an IRC channel anytime a post is made to my site
<CM-Punk> http://pastebin.com/1maXeCv9 I still don't know why this isn't working
<dpg> I have it defined in another method (create) where the @post is floating around
<dpg> I want it to join the channel, then post the title - url of the @post
<dpg> then part
<dpg> I also have another question about running cinch with delayed_job
<dpg> (it doesn't work)
<dpg> OOB.
<dominikh> (I have no idea what delayed_job is). as for instance variables in that block, the block executes in a different context. but there's no need to use Bot.new with a block. you can do bot = Bot.new; bot.config.foo = bar; bot.start
<dpg> then just access bot.config.foo by calling self.config.foo ?
<dpg> from inside?
<dominikh> I'm not sure what "inside" you're refering to since we eliminated the block
v0n has joined #cinch
<dpg> I still have to ... snap you're right.
<dpg> I need coffee.
<dpg> delayed_job is a background job queuing process
<dominikh> http://sprunge.us/SMWW something like this
<dpg> tosses things in a queue after marshalling them.
<dpg> Yep. you rock. thanks for that.
<dpg> I'm using it so it doesn't stop the posting processing
<dominikh> and how's cinch not working with it?
<dpg> just gives me this random argument count error: http://i.imgur.com/5Rk92jY.png
<dominikh> well, that doesn't look Cinch related at a glance
<dpg> full gist is here: https://gist.github.com/ctwiz/8718191
<Cinchy> [gist] gist:8718191 (at gist.github.com, ctwiz on 2014-01-30 20:37)
<dpg> full trace*
<dpg> ok cool. I'll take a look at it some more.
<dpg> I appreciate the help. :)
<dominikh> remind me of ruby stacktraces, top is the last call?
<dominikh> what value exactly are you pushing into that queue?
<dominikh> a bot instance?
<dpg> yeah
<dpg> bot.delay.start
<dpg> so it serializes the data
<dpg> s/data/object/
<dpg> then runs it when it's available
<dominikh> okay, thing is: that delay lib is calling respond_to? on the Bot. it passes two arguments, which apparently is possible since some time. our respond_to? (we overwrote it) only accepts one value. thus the exception
<dpg> bot.start (hopefully)
<dpg> ah.
<dpg> alright. thanks. maybe I can submit a pull request?
<dominikh> I could patch that (quicker than working on a PR), but I sort of don't feel like bumping the version for that :/ as a matter of fact I wonder why it calls respond_to?
<dpg> no worries. I'll just fork it.
<dpg> easier for me, and you won't have to worry about it.
<dpg> I appreciate the help though. Thanks a ton. and great work on the code.
<dominikh> meh, I'll push a new version
<dpg> awesome. :)
<dominikh> easier for both of us in case someone else runs into the same thing
<dpg> sounds good.
<dpg> you're a rockstar
<dpg> this you on twitter? @dominikh
<dominikh> nope
<dominikh> I'm @dominikhonnef on there; but I hardly ever tweet
<dpg> cool. following you anyways, just in case you want to one day. :)
<dominikh> hehe
<dominikh> looks like respond_to had that second argument for ages, so it's a bug in Cinch anyway
<CM-Punk> So, any ideas?
<dominikh> dpg: I pushed cinch 2.0.12 to rubygems; github will follow soon
<dpg> cool thanks!
nOgAnOo has quit [Quit: Hard forks?! Hash Tables?! Someone tell me what's going on here!!!! I love you forever and always.]
postmodern has joined #cinch
onewheelskyward has joined #cinch
skybotalpha has joined #cinch
nOgAnOo has joined #cinch
v0n has quit [Ping timeout: 240 seconds]
Namaste_ has joined #cinch
CM-Punk has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
Namaste_ is now known as CM-Punk