dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.0.11
Dunke is now known as Dunke|sleep
v0n has joined #cinch
thews_ has joined #cinch
txdv_ has joined #cinch
txdv has quit [*.net *.split]
thews has quit [*.net *.split]
[krisbulman] is now known as krisbulman
krisbulman is now known as [krisbulman]
[krisbulman] is now known as krisbulman
nOgAnOo has quit [Ping timeout: 250 seconds]
krisbulman is now known as [krisbulman]
[krisbulman] is now known as krisbulman
nOgAnOo has joined #cinch
nOgAnOo has quit [Excess Flood]
krisbulman is now known as [krisbulman]
[krisbulman] is now known as krisbulman
krisbulman is now known as [krisbulman]
nOgAnOo has joined #cinch
nOgAnOo has quit [Excess Flood]
nOgAnOo has joined #cinch
v0n has quit [Ping timeout: 245 seconds]
rails has joined #cinch
* rails sits on dwarf
<rails> dominikh: Bot:oper works nicely on rizon, lol
[krisbulman] is now known as krisbulman
krisbulman is now known as [krisbulman]
nOgAnOo has quit [Ping timeout: 260 seconds]
<CM-Punk> http://pastebin.com/r5mcJQBk Can anyone tell me why the 'hourly' methods are throwing argument exceptions and such? I have been trying for hours to feed the arguments correctly and it's just not working right
<ayonix> If you have logs anyway, post them as well..
<CM-Punk> This is the exception I'm getting
<CM-Punk> [2014/02/09 03:52:56.682] !! lib/eve/plugins/weather.rb:47:in `hourly': undefined local variable or method `m' for #<Cinch::Plugins::Weather:0x985191c> (NameError)
<CM-Punk> But if I add 'm' to the args I get an argument error
<CM-Punk> So, I am pulling my hair out
<CM-Punk> ayonix ^
<ayonix> You definitely need to add m as first argument
<CM-Punk> Right, I get that
<CM-Punk> When I do it I get an argument error...
<CM-Punk> Hold on
<CM-Punk> ayonix here is the exception I get after adding m as the first argument
<CM-Punk> [2014/02/09 03:58:32.650] !! lib/eve/plugins/weather.rb:39:in `hourly': wrong number of arguments (0 for 3) (ArgumentError)
<CM-Punk> [2014/02/09 03:58:32.650] !! lib/eve/plugins/weather.rb:95:in `hourly_summary'
<CM-Punk> [2014/02/09 03:58:32.650] !! lib/eve/plugins/weather.rb:47:in `hourly'
<ayonix> Because of your hourly_summary
<CM-Punk> What's wrong with it?
<ayonix> You call hourly there...
<CM-Punk> Okay
<CM-Punk> So I changed that to get_hourly
<CM-Punk> Which is where it's supposed to be getting the info from
<CM-Punk> [2014/02/09 04:04:39.815] !! lib/eve/plugins/weather.rb:83:in `get_hourly': wrong number of arguments (0 for 2) (ArgumentError)
<CM-Punk> [2014/02/09 04:04:39.815] !! lib/eve/plugins/weather.rb:95:in `hourly_summary'
<CM-Punk> [2014/02/09 04:04:39.815] !! lib/eve/plugins/weather.rb:47:in `hourly'
<CM-Punk> That's the exception I get nao, ayonix
<ayonix> Update the pastebin
<CM-Punk> Updated
<ayonix> link?
<ayonix> what do you think return get_hourly[hour.to_i - 1] does?
<CM-Punk> A partner coded that, I think he thinks it's supposed to scan the data in get_hourly and return it based on the number provided in the second matcher
<CM-Punk> He coded that part
<ayonix> well.. the thing i wanted to point out is: get_hourly is a method, that takes 2 parameters
<CM-Punk> Correct
<ayonix> get_hourly[hour.to_i] is a method call: get_hourly() (0 arguments passed, 2 expected => error) and then tries to access the returned array of the result of the method at the specified position
<CM-Punk> So
<CM-Punk> It should be
<CM-Punk> Well, I don't even know.
<CM-Punk> All I know, is I need it to return the data needed from get_hourly, and it should gather the information at the specified position of the JSon API
<CM-Punk> Specified by the first argument of the 'f' matcher
<CM-Punk> Up to [23]
<ayonix> line 44 does exactly that?
<ayonix> in hourly_summary you're trying exactly the same, just without geometry and hour..
<CM-Punk> If you look at 'current' 'get_current' and 'current_summary'
<CM-Punk> I am trying to replicate that with the hourly group
<CM-Punk> With a much wider array of results
<CM-Punk> The results should be based on the user's request for 'hour'
<ayonix> why didn't you do it like in the "current" way already
<ayonix> in `hourly` you have the data already
<ayonix> pass the data and the hour to the `summary` and do whatever you want with it then :S
<ayonix> i.e. NOT calling get_hourly again
<CM-Punk> Because I need a method to determine where in the JSon to get the results from
<CM-Punk> http://pastebin.com/paHeGsxm That's an example of the API I'm working with
<CM-Punk> The highlighted area is the array of hours
<CM-Punk> I don't have the data in 'hourly' I have it set to have 'get_hourly' handle the opening and parsing of the JSon
<CM-Punk> And 'hourly_summary' is supposed to pick the results and deliver them based on the hour and locations specified in the matcher
<ayonix> data = get_hourly(hour, geometry) is in `hourly`, and you say you don't have the data there?
<CM-Punk> Yes, because it's saying that 'data' is the information gathered from 'get_hourly'
<CM-Punk> Which is then to be parsed by 'hourly_summary'
<ayonix> why don't you just do it that way
<CM-Punk> ...
<CM-Punk> That is what I am trying to do.
<ayonix> call hourly_summary(data, hour) and do it
<CM-Punk> And when I do that, I get
<CM-Punk> [2014/02/09 04:29:42.222] !! lib/eve/plugins/weather.rb:83:in `get_hourly': wrong number of arguments (0 for 2) (ArgumentError)
<CM-Punk> [2014/02/09 04:29:42.222] !! lib/eve/plugins/weather.rb:95:in `hourly_summary'
<CM-Punk> [2014/02/09 04:29:42.222] !! lib/eve/plugins/weather.rb:47:in `hourl
<ayonix> .......
<ayonix> you are still trying to call get_hourly without arguments
kludge` has quit [Ping timeout: 248 seconds]
<CM-Punk> ayonix
<CM-Punk> Omg
<CM-Punk> That works
<ayonix> no shit...
<CM-Punk> Okay, so what did you do? I want to be certain I learn from this
<ayonix> i've told you everything already
<CM-Punk> All you did was change
<CM-Punk> get_hourly[hour.to_i....blah blah
<CM-Punk> to
<CM-Punk> data[hour.to_i....blah blah?
<ayonix> and pass the data in there, yes
<CM-Punk> Okay
<CM-Punk> Awesome
<CM-Punk> Something so simple
<CM-Punk> I must have just had my brain wrapped in this so much over the last few days
<CM-Punk> Plus involving my friend...
<CM-Punk> Thank you, now I can learn and move on
kludge` has joined #cinch
Dunke|sleep is now known as Dunke
cyrusdavid has quit [Ping timeout: 252 seconds]
txdv_ has quit [Read error: Connection reset by peer]
txdv has joined #cinch
v0n has joined #cinch
lagweezle has joined #cinch
txdv has quit [Read error: Connection reset by peer]
txdv has joined #cinch
[krisbulman] is now known as krisbulman
krisbulman is now known as [krisbulman]
<CM-Punk> How do I get my bot to send messages in utf-8 encoding?
<dominikh> in the default configuration, it will use CP-1252 if the message fits into that encoding, otherwise use UTF-8. you can set e.encoding to :utf8 if you want to force utf-8. but that's also for incoming messages
<dominikh> the CP-1252 + UTF-8 combination has the highest compatibility since most clients either support CP-1252 or they support the combination we use
<CM-Punk> Okay
<CM-Punk> Well dominikh, there is a particular message I am trying to send that doesn't match CP-1252 encoding apparently, because degree symbols are showing up as ? marks
<dominikh> are you sure your *input*, the string you pass to send/reply is actually in UTF-8?
<CM-Punk> I don't want to sound like a complete dunce here but...I don't follow you
<CM-Punk> There is the plugin, also having trouble with the last two matchers, anyway, the entire thing is encoded in UTF-8, and I typed the degree symbols myself
<dominikh> bring the bot here and show me then
<dominikh> also tell me where in those bloody 200 lines the degree sign is…
<CM-Punk> dominikh for example line 122
<dominikh> what version of Ruby are you using?
<CM-Punk> 2.1 I think
Keli has joined #cinch
<CM-Punk> ~df 2 48186
<Keli> Daily Forecast: - Westland, MI 48186, USA: Forecast Predicted in 2 day(s): Mostly cloudy throughout the day. | Temp: [ Min: 5.63°F (-14.6 C) | Max: 16.47°F (-8.6 C) ] - Will Feel Like: [ Min: -7.48°F (-21.9 C) | Max: 5.28°F (-14.8 C) ] | Wind: [ Speed: 7.64 MPH (12.3 KPH) | Bearing: 276 ]
<CM-Punk> There dominikh
cloud|nix has joined #cinch
<dominikh> (the degree sign is in CP1252)
<leftylink> I see degree signs in that message, no problem
<dominikh> then your client doesn't support the aforementioned combination of cp1252 and utf-8
<CM-Punk> I used Notepad++ to encode it all to UTF-8
<dominikh> so?
<CM-Punk> So, how do I make it work so people don't see that?
<dominikh> I already answered all of those questions
<dominikh> read what I wrote, read http://rubydoc.info/gems/cinch/file/docs/encodings.md and then figure it out :)
<Cinchy> [URL] File: Encodings — Documentation for cinch (2.0.12)
<CM-Punk> Okay I read that
<CM-Punk> It basically makes no sense to me
<CM-Punk> "you can set e.encoding to :utf8"
<CM-Punk> How?
<dominikh> the same way you set every other bloody option.
[krisbulman] is now known as krisbulman
<dominikh> *c.encoding
<CM-Punk> In the configuration?
<CM-Punk> Like bot.rb?
<CM-Punk> c.nick = "Keli" c.user = "Eve" c.encoding "UTF-8"
<CM-Punk> Like that?
krisbulman is now known as [krisbulman]
<Keli> :D
<CM-Punk> ~part
Keli has left #cinch [#cinch]
[krisbulman] is now known as krisbulman
krisbulman is now known as [krisbulman]
<CM-Punk> [2014/02/09 12:43:59.212] !! /home/eve/.rvm/gems/ruby-2.0.0-p353/gems/cinch-2.0.11/lib/cinch/utilities/encoding.rb:47:in `encode!': code converter not found (UTF-8 to :utf8) (Encoding::ConverterNotFoundError)
<dominikh> try "UTF-8" isntead of :utf8
[krisbulman] is now known as krisbulman
<CM-Punk> That worked dominikh, thank you. Now for a follow up question. You were sure to warn me that that was for incoming messages as well, would that be expected to cause complications down the road?
<dominikh> if you have people in the channel that don't use UTF-8 it might.
* CM-Punk nods
<CM-Punk> Makes sense, and there's no way to set that to just apply to a single plugin?
<dominikh> no.
<CM-Punk> Alright, one more question, about my matchers in that plugin
Keli has joined #cinch
<CM-Punk> ~df 3 westland, mi
<Keli> Daily Forecast: - Michigan, USA: Forecast Predicted in 3 westland, day(s): Mostly cloudy throughout the day. | Temp: [ Min: -4.52°F (-20.2 C) | Max: 13.95°F (-10.0 C) ] - Will Feel Like: [ Min: -10.48°F (-23.6 C) | Max: 3.49°F (-15.8 C) ] | Wind: [ Speed: 3.43 MPH (5.5 KPH) | Bearing: 182 ]
<CM-Punk> How do I get it to seperate it properly?
<CM-Punk> I know the regex is apparently incorrect to do that
<CM-Punk> I just don't know what is wrong
<CM-Punk> ~part
Keli has left #cinch [#cinch]
<ayonix> ...what do you mean by "seperate it properly"?
<leftylink> well, see how there's a /df (.+) (.+)/
<CM-Punk> Also, you had said "<dominikh> (the degree sign is in CP1252)" without setting a global encoding option if I were to put the degree sign in UTF-8 within the plugin, would it send it as UTF-8?
<CM-Punk> ayonix and leftylink
<CM-Punk> It's combining
<leftylink> the question is why match[1] = "3 westland," and match[2] = "mi", rather than match[1] = "3" and match[2] = "westland, mi"
<CM-Punk> Exactly
<CM-Punk> That's what I'm trying to do
<dominikh> CM-Punk: Cinch encodes outgoing messages. your degree sign in the code should be UTF-8. that doesn't mean Cinch won't reencode it when you send the message
<CM-Punk> Oh okay
<CM-Punk> Got it
<ayonix> http://www.ruby-doc.org/core-2.1.0/Regexp.html : "Repetition is greedy by default. [...] A greedy metacharacter can be made lazy by following it with ?."
<CM-Punk> Ohhhhhhhh
<CM-Punk> Okay
v0n has quit [Ping timeout: 245 seconds]
krisbulman is now known as [krisbulman]
nOgAnOo has joined #cinch
cloud|nix has quit [Ping timeout: 245 seconds]
v0n has joined #cinch
v0n has quit [Ping timeout: 245 seconds]
[krisbulman] is now known as krisbulman
v0n has joined #cinch
v0n has quit [Ping timeout: 246 seconds]
Dunke is now known as Dunke|sleep