« first day (2011 days earlier)      last day (1769 days later) » 

12:17 AM
@superancetre Currently rate limiting is up to the client :( You could extend the script to include a call to https://api.twitter.com/1.1/application/rate_limit_status.json
 
@rgchris i'll look into it, not sure how to procede yet. As a newcomer to Rebol, reading into the response from 'twitter/find' as 'tweets/statuses/1/text' is pretty awesome btw!
 
:)
I need to revisit the way the Twitter script works, it could use some work to make it more usable/extensible.
 
Is ren-c available as a library that can be invoked by other programs?
@HostileFork I presume it's compiled into ren garden instead of being used as a library
 
12:40 AM
@rgchris where is send/with defined in reb4.me/r/twitter? it seems you dont import it from either library and it's not a standard refinement of send as far as i can tell from the REPL. I'm missing something right?
 
@superancetre There's two parts to the Twitter script—the first part is the public facing functions (the twitter object), the second part are private functions. SEND is defined in the second part. Just do a search for send:
 
@rgchris ohh i was looking for "send/with", should have only looked for send. Thx!
 
 
2 hours later…
2:53 AM
@rgchris i tried to implement something for the rate limit, there is your twitter lib with some addition http://pastie.org/10821651.

Line 62 is the function i added, for now the parameter is hardcoded for test.

I have a few issues: on the twitter dev page https://dev.twitter.com/rest/reference/get/application/rate_limit_status it read that you should be able to have multiples keywords comma separated. But if i write "users,search" instead of "search", Twitter send me an error back. Do you have any idea why? i tried to mold the value, either it gives me nothing back or it throw an error.
Line 131 i also added a block
And second issue, i have to use 'load-json/flat instead of 'load-json, and that gives me back data that is harder to parse. Any idea of why and how to fix this?
 
3:40 AM
@superancetre TO-WEBFORM doesn't encode commas, however OAuth seems to expect this. A quick fix is to change line 189 to: url-encode replace/all replace/all to-webform params "+" "%20" "," "%2C"
I'm surprised this hasn't been an issue before...
@superancetre As to /FLAT: LOAD-JSON doesn't like this key— "\/search\/tweets":
 
4:00 AM
@rgchris could you explain a bit more what you mean about LOAD-JSON and the key "\/search\/tweets"?
 
@superancetre In the Rebol 2 version of AltJSON, JSON objects are imported as Rebol objects. The limitation to this approach is that the keys need to conform to Rebol word naming conventions. As not all JSON object keys do conform, I added a /FLAT refinement that uses tag/value paired blocks in place of objects to accommodate a wider variety of keys.
(this problem doesn't exist in Rebol 3 as JSON objects are imported as Rebol maps)
 
@rgchris hok gotcha, i guess there is no workaround then? If i keep using Rebol 2 i'll have to find a way to read the interesting values the hard way ?
 
I had added a workaround for spaces that looks something like:
@RebolBot do/2
do reb4.me/r/altjson
probe load-json {{"a key":null}}
 
; Brought to you by: try.rebol.nl
make object! [
    a^_key: none
]
== RESULT is an object of value:
   a^_key          none!     none
 
I could add a similar workaround for '/'.
 
4:22 AM
@rgchris There is no hurry.
Thx you a lot, you've been very helpful!
 
@superancetre I tried it anyway :)
@RebolBot do/2
do reb4.me/r/altjson
probe load-json {{"/a/key":null}}
 
; Brought to you by: try.rebol.nl
make object! [
    ^sa^skey: none
]
== RESULT is an object of value:
   ^sa^skey        none!     none
 
Not pretty, but then neither is using slashes within keys :)
@superancetre NP, hope you like using Rebol!
 
@rgchris what about using a Parse rule to remplace the slashes by valid chars? Would that be prettier?

And yeah its pretty interesting! After 2 days trying it i like it :)
 
@superancetre The reason for using escapes is you can then also go back the way:
@RebolBot do/2
do reb4.me/r/altjson
to-json load-json {{"\/a\/key":123}}
 
4:33 AM
; Brought to you by: try.rebol.nl
== {{"\/a\/key":123}}
 
@rgchris right, in the real world you have to be careful when you transform data ;)
 
Indeed!
As and when Rebol 3 or Red rule the roost, such hacks will be unnecessary:
@RebolBot
do reb4.me/r3/altjson
load-json {{"\/a\/key":123}}
 
; Brought to you by: try.rebol.nl
== make map! [
    "/a/key" 123
]
 
@RebolBot
do reb4.me/r3/altjson
result: load-json {{"\/a\/key":123}}
result/("/a/key")
 
; Brought to you by: try.rebol.nl
== 123
 
4:39 AM
As a new user, should i go toward Rebol 3 instead of beginning with Rebol 2? And what about Red?
 
Depends what your goals are. Rebol 2 is perhaps the most complete, but is showing its age compared to the new kids (no maps, limited utf-8 handling, not open source, to name but a few...).
 
For now my goal is to make a few toy projects to learn Rebol. I tried to launch Red but it missed a few graphics component to run the tutorial, so i came back to Rebol 2.
 
5:04 AM
It certainly seems that Red is catching up fast to Rebol 2's GUI capabilities, but Rebol 2 is still better documented at this time and thus might be the better platform to learn on. Rebol 2, Red and Rebol 3 are similar enough that you can make the jump to another when it has the capabilities you need.
 
@rgchris have you tried Red/GUI ?
 
Tangentally, is there no CHANGE in Red 0.6.0?
 
I think it's windows only so far.
 
@GrahamChiu No, not yet.
 
And you're on osx aren't you?
 
5:08 AM
Yep.
red> head change [Red is like Rebol] [I am]
 
; Brought to you by: try.rebol.nl
*** Script error: change has no value
*** Where: head
*** Stack: do-console all not unset? set do _execute if all not unset? set do head
 
>> head change [Red is like Rebol] [I am]
 
; Brought to you by: try.rebol.nl
== [I am like Rebol]
 
Has anyone used rebol3 as a dll?
 
Possibly Robert? or Shixin?
 
5:13 AM
so, 6 months possibly for Android gui .. so need to use something else pro tem
and I was wondering if I could use r3 as a library in the meantime
But ...
 
5:34 AM
The most recent Red has change already
red>> head change [Red is like Rebol] [I am]
== [I am like Rebol]
 
 
8 hours later…
1:29 PM
0
Q: How read file real time for chat application?

lechuckI'm trying to write a simple chat application in Rebol which is based on a single text file. What would be the best way to read that file "real time"? Right now I've got it working with this: t1: text 600x300 wrap green black font-name font-fixed rate 1 feel[ engage: func [face action e...

 
 
2 hours later…
3:16 PM
@rgchris Would you mind adding another special rules in altjson please? There are keys containing ":" in some of the json Twitter send me back. i tried fiddling with the lib but couldnt make the fix work myself

@RebolBot
do http://reb4.me/r/altjson
load-json {{"a:key":123}}
 

« first day (2011 days earlier)      last day (1769 days later) »