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)
<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>
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>
[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