• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r4wp

[Web] Anything related to the WWW

MaxV
7-Aug-2012
[27]
Yes, it's obvius. Frankly it depends on what data you want to "share". 
I like google documents for storing files to edit when I travel ,not 
very important documents. For example: if you would plan a kamikaze 
attack or write a personal diary on your sexual orientation, I didn't 
suggest you to use google documents.
Gerard
17-Aug-2012
[28x2]
It seems to me that under Red, one marvelous tool which could be 
created would be similar this new one - which I just discovered ... 
at least with my not too long vision  - based on the Cheyenne HTTP 
server, it seems it could be realized using a similar approach, to 
begin with ... http://www.wakanda.org/overview- Also available 
on Github for those interested to look at the code (may be Topaz 
friends - sinc it is base entirely on Javascript).
Could not JS everywhere someday be replaced by Red everywhere - or 
some derived fork ?
Kaj
17-Aug-2012
[30]
Yes; they have a good model, but it's all ugly web technologies
Gerard
17-Aug-2012
[31x2]
I agree but what else could be used - something built aroud the JVM 
- may be ? It must be a bit like Carl's REBOL based vision, isn't 
it ? Entirely self contained to be deployed anywhere but written 
once ...
Now it could be Red based instead ;-)
Kaj
18-Aug-2012
[33]
Yes, all true. I've long been working on a system with roughly that 
model, but we only use it internally so far
Gerard
18-Aug-2012
[34x3]
Nice, do you use some GUI for the output, kind of VId I suppose ?
Or do you send the output to some esternal receiver using messages 
 protocols ?
But then how do you catch the input if it not already part of your 
own system ?
Kaj
18-Aug-2012
[37x2]
It's a web system currently, but it's prepared to support other platforms. 
My Try REBOL site is made with it
REBOL 2 is no use to me because it would never run on Syllable, and 
REBOL 3 still only has a GUI for Windows and Amiga, so it hasn't 
been useful for me to make a VID frontend
Chris
17-Sep-2012
[39]
(from #Red) - Arnold, which version of Make Doc are you using? I've 
many iterations of MD that I've hacked away at over the years, perhaps 
I'll have something that will be easier to hack?  Most recent version 
I put together for the 'Notes For the Road' site, has some nice features 
- currently hacking at it again for a more ambitious QM project...
Arnold
17-Sep-2012
[40]
Chris, I am stil figuring this out. I want bold/italic/(underline)/(em) 
paragrapphs separated with a blank line (easier to understand and 
no need to delete a routinely typed 'return'-key) h1/h2/h3 img (inline/left 
right center aligned) and a-href, only 1 level of bullits, and I 
think I can come along without numbered sections. I was thinking 
about mark-up delimiters on the beginning of the line like === ==+ 
==- ==* ==#   I kind of liked \note and /note or /code but everybody 
will forget if the first one will be fore or backslashed so I guess 
the indented version to produce code. Plus I want the markup to be 
from a css file. No need to make this within the script because the 
template/and a script can take care of where and which to link to. 
That's about it.
Chris
18-Sep-2012
[41x2]
Doesn't sound too onerous - I'd say most of the changes could be 
made to the parser, then tweak the emitter to get the output you 
want. Do you have a sample document? Is this the version you're using? 
- http://reb4.me/r/xhtml
(or tried?)
Arnold
18-Sep-2012
[43]
This is a new version to me. I was still busy figuring out most of 
the used parses.
Arnold
19-Sep-2012
[44x3]
I tried some today, not satisfactory results yet.
figured out the line write %mijndoc.htmlÊgen-doc read %mijndoc.txt
makedoc2 results on the other hand were nicer but that was not it 
either.
Chris
20-Sep-2012
[47x2]
The structure of MD since v2 is a separation of scanner and emitter. 
'scan-doc will break text into a block of [style content] pairs. 
'gen-doc will take that block and turn it into something, most commonly 
HTML.


The features of your doc - using your ==+, ==#, etc. are in the spec 
of the parser. Loosely explained, the parser's rule 'resets' when 
it encounters a newline.  It defines a few paragraph types that copies 
chunks of text (including 'paragraph that consumes text AND single 
newlines).  The rest of the rule determines the paragraph style and 
expected paragraph type:

  "===" text-line (emit sect1 text)

Could just as easily be:

  "==+" paragraph (emit my-bold-paragraph para)



The way a document is presented is all in the emitter. Seems this 
is where you seem to be yearning for most control. My first motivation 
using MakeDoc was stripping it of any styles - I just wanted a minimum 
of HTML markup that could be embedded and properly moulded by CSS. 
In my script above, I iterate through the [style content] list and 
use 'switch to determine how to handle each, this should be sufficient 
for documents without any complexity. It's really then just a case 
of modifying the HTML that is emitted.



Example of script used in RSP (exposes [escape-html scan-doc gen-doc]):


  <link rel="stylesheet" href="http://ross-gill.com/styles/anywhere.css">
  <% do http://reb4.me/r/xhtml%>

  <pre><code><%= mold doc: scan-doc some-input-text %></code></pre>
  <%= gen-doc doc %>

How it looks depends on the stylesheet you use.
I really should update that script though - a succinct version of 
make-doc though it is, it could use a bit of a refresh.
Endo
27-Sep-2012
[49x2]
Chris: I'm trying to use oauth with Salesforce, can you help me about 
it?

I have consumer-key and consumer-secret, but where do I set login_url? 

I'm trying your Etsy with Salesforce. I thought that I at least should 
be able to login.
I get "** User Error: Handshake Response does not contain Login URL" 
when I try etsy/as "username"
Chris
27-Sep-2012
[51x2]
http://www.salesforce.com/us/developer/docs/api_rest/Content/quickstart_oauth.htm

Is this the API you're trying to access?  Looks as if it uses OAuth 
2.0 (Etsy and Twitter are 1.0) - I'm not fully aware what the differences 
are.  Note that even though Twitter and Etsy both use the same signing 
method (OAuth), they differ in how you get the user key - looks as 
if this one is different again...
Hmm, that came across as unreadable here : ) - here it is again:


http://www.salesforce.com/us/developer/docs/api_rest/Content/quickstart_oauth.htm



Is this the API you're trying to access?  Looks as if it uses OAuth 
2.0 (Etsy and Twitter are 1.0) - I'm not fully aware what the differences 
are.  Note that even though Twitter and Etsy both use the same signing 
method (OAuth), they differ in how you get the user key - looks as 
if this one is different again...
Kaj
27-Sep-2012
[53]
They're quite different
Chris
27-Sep-2012
[54x7]
Ok, in an effort to disentangle some of the OAuth code from specific 
implementations, here is an *experimental*, *largely untested* port 
scheme that does just that.
do http://reb4.me/r/oauth

test-site: http://192.168.0.60.xip.io:8080/

probe-lowercase: func [str [string!]][
    lowercase copy str
]

read [
    scheme: 'oauth
    target: 'get
    url: test-site
    user-data: context [a: "Foo"] ; params
    key: make key [
        consumer-key: consumer-secret: "Your Keys Here"
    ]
    user: make user [token: secret: "Your User Keys Here"]
    awake: :probe-lowercase ; result processor, like :load-json
]
(obviously you'll need to change the test-site to your own test service)
I'm pretty sure this is a grevious abuse of R2's port system, but 
it does mean there is no new global words.
Yey! Works with Twitter!!
do http://reb4.me/r/oauth
do http://reb4.me/r/altjson

tm: read [
	scheme: 'oauth
	url: https://api.twitter.com/1/statuses/home_timeline.json
	target: 'get
	user-data: context [count: 10]
	key: make key [
		Consumer-Key: #consumer_key
		Consumer-Secret: #consumer_secret
	]
	user: make user [
		token: #user_key
		secret: #user_secret
	]
	awake: :load-json
]
Endo, I don't think this will help you with Salesforce, but breaking 
the OAuth part out should make it easier to adapt to OAuth 2.0.
Endo
28-Sep-2012
[61]
Wow thanks a lot Chris! Thanks for separating OAuth port scheme, 
unfortunately I'm not familiar with OAuth but I'll try it with Salesforce. 
Thanks a lot!
Gabriele
28-Sep-2012
[62]
http://hueniverse.com/2012/07/oauth-2-0-and-the-road-to-hell/
Endo
28-Sep-2012
[63x3]
I know, I already read it. But SF uses OAuth 2. :(
Is GET supported in read/custom ?
print read/custom http://localhost/test.rsp[get "a=b&c=d"]
Or should I use Graham's custom http?
GrahamC
28-Sep-2012
[66]
Read is GET
Endo
28-Sep-2012
[67]
I tried to change the method without changing the URL when switching 
POST and GET. Didn't work. Anyway, not a problem.
GrahamC
28-Sep-2012
[68x3]
not sure why you want read/custom for unless you're altering the 
header contents
read http://localhost.rsp?a=b&c=d
read/custom http://localhost.rsp?a=b&c=d[ header [ Cookie: "authtoken=anotherfoo" 
]]
Endo
28-Sep-2012
[71]
There are different authentication methods on Salesforce, so I'm 
just testing.
Chris
4-Oct-2012
[72]
I am new to Git. I'd like to use it (or something similar) to keep 
a distributed copy of a web app I am developing. I'd like copies 
on two local systems (laptop and desktop) with the possibility of 
sharing with another developer based far away and deploying the app 
on my web host.


I sort of get the concept (at least the part about commits, etc), 
but am not really sure how to keep everything in sync. Is it worth 
using a hosting service like GitHub or Bitbucket (I know that perhaps 
defeats the purpose) to assure availability or figuring out how to 
use the web host for this purpose?
Kaj
4-Oct-2012
[73]
You may want to try Fossil. It's much easier to run your own server
Andreas
4-Oct-2012
[74]
To "keep everything in sync" with Git, you have have to do pairwise 
syncs. Each pairwise sync can be initiated from either side, the 
respective commands being "fetch" (from remote to local) and "push" 
(from local to remote).


If you want to keep many separate sites in sync, mediating the sync 
via a central host makes sense (as it avoids the exponential explosion 
of pairwise syncs).


If you have SSH access to your web host, using your web host for 
a central Git repository is trivial (assuming you have - or can get 
- Git installed on the web host).
Chris
4-Oct-2012
[75x2]
In this one case, the host has instructions to set up Git on a subdomain. 
I'd have to consider it as it doesn't appear to be private.
Thanks Kaj, will look it over...