[REBOL] Email setup question Re:
It depends. If you are using a Web hosting service for your CGI setup, they may have disabled SMTP. Many Web hosting services disable SMTP and instead want you to use perl sendmail. > >Can someone tell me why I get this error when trying to send mail through a >CGI form? > >Sending Email to [EMAIL PROTECTED] ** User Error: No network server >for smtp is specified. ** Where: smtp-port: open [scheme: 'smtp] if email?
[REBOL] Question: Move the REBOL List? Re:
Carl- So long as the list continues to send e-mail to the eScribe archive, I'm all for it (smart search engine there.) Also, is there any way you can make all past messages available in some kind of package? I could then update the eScribe archive with messages before July 2000. -Ryan >It's great to have so much activity happening with REBOL these days. >Unfortunately, our servers are overloading. We're starting to have gigabyte >days. While it is good to have all this activity, it is making life >difficult for a few folks around here. What would you think if we were to >move this main list to a site like egroups.com? That would also give you web >access to archives, file lists, and other features. > >Your thoughts? > >-Carl > > > >
[REBOL] CGI to frame question Re:
I believe... http://www.domain.dom/cgi-bin/script.cgi" target= "frame1"> The target attribute defines the output location for the action. (this is just an educated guess since I've never actually done this myself.) -Ryan >Is there an example of how one can send REBOL CGI output to a particular >frame somewhere? can someone give me an example?
[REBOL] script not terminating, continues to replicate Re:(3)
The script is activated with an exec cgi statement within a server-side include. >Ryan wrote: >> Besides the horribly inefficient code, what could be wrong with this >script (below) that would be causing problems? > >It could be a problem in your JavaScript? Or HTML for frames?
[REBOL] runaway cgi Re:(3)
It is the /Core 2.3 version for Solaris on Sparc. >What versions are being used? Released/Experimental? >Does the script have iterative sections or is it guaranteed to complete? > >I absolutely want to avoid such a scenario and is the main reason I haven't >been experimenting with CGI on an ISP server yet so I would like to know if >it Rebol or not. > >Thanks, > >Brett. > >- Original Message - >From: <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Friday, October 06, 2000 2:51 PM >Subject: [REBOL] runaway cgi Re: > > >> Hi Ryan: >> I'm just curious, but is this a secure site? Or >> more precisely are any of the cgi programs linked >> through a secure URL? >> >> I have had that problem myself. Runaway process >> that ate up to 98% of server resources. >> That reminds me, I need to check >> on that end to see if latest /core for linux has solved >> that >> -Tim >> >> [EMAIL PROTECTED] wrote: >> >> > OK. My hosting service shut down The BeOS Journal at http:// >> > www.beosjournal.com because of a "runaway CGI/PERL script." Well, the >site is >> > built dynamically using REBOL. What next? I asked them for stats to see >if it >> > might have been a DoS attack or whatever, but I'm still waiting. Sigh. >> > >> > -Ryan >> > >
[REBOL] runaway cgi Re:(2)
I just use a basic hosting service. I don't understand what might have gone wrong. >Hi Ryan: >I'm just curious, but is this a secure site? Or >more precisely are any of the cgi programs linked >through a secure URL? > >I have had that problem myself. Runaway process >that ate up to 98% of server resources. >That reminds me, I need to check >on that end to see if latest /core for linux has solved >that >-Tim > >[EMAIL PROTECTED] wrote: > >> OK. My hosting service shut down The BeOS Journal at http:// >> www.beosjournal.com because of a "runaway CGI/PERL script." Well, the site >is >> built dynamically using REBOL. What next? I asked them for stats to see if >it >> might have been a DoS attack or whatever, but I'm still waiting. Sigh. >> >> -Ryan > >
[REBOL] script not terminating, continues to replicate
Besides the horribly inefficient code, what could be wrong with this script (below) that would be causing problems? My hosting service said they suspended my site because "This script has been running constantly since the site was re-enabled, with 10 plus copies running on each webserver. Not only does this monopolize system resources, but the script does not terminate properly and continues to replicate. We cannot permit scripts with programming errors on our servers as they impact the behavior of other customer sites." -Ryan #!rebol -cs REBOL [ Title: "Banner Ad Randomizer" File: %webbanner.cgi Date: 16-Apr-2000 Author: "Ryan Christiansen" Purpose: { Generate HTML code that displays a linked banner advertisement } ] urls: [ "http://www.schonder.com" "http://www.abisoft.com/BePlan/PurchaseBOSJ.html" "http://www.lebuzz.com/buzzcd_ad.html" "http://www.bebits.com/app/867" "http://www.bug.org.yu" "http://www.goingware.com" "http://www.gobe.com" ] imgs: [ "dasbebook.gif" "BePlan.gif" "buzzcd_anim.gif" "ImageProAd.gif" "yugobug.gif" "goingware.gif" "gobe.gif" ] alts: [ "Das BeBook at Papier-Schonder KG office supply and bookstore" "BePlan from AbiSoft" "BuzzCD - Hand-picked best BeOS software" "ImagePro displays, zooms, and re-sizes images" "BUG YUgoslavia" "GoingWare, Inc. - Expert software consulting and development" "Gobe Software" ] heights: [ 60 59 59 59 52 60 60 ] widths: [ 468 467 467 467 115 468 468 ] random/seed now ad: random 7 url: pick urls ad img: pick imgs ad alt: pick alts ad height: pick heights ad width: pick widths ad print "Content-Type: text/html^/" print rejoin [{ }]
[REBOL] runaway cgi
OK. My hosting service shut down The BeOS Journal at http:// www.beosjournal.com because of a "runaway CGI/PERL script." Well, the site is built dynamically using REBOL. What next? I asked them for stats to see if it might have been a DoS attack or whatever, but I'm still waiting. Sigh. -Ryan
[REBOL] shifting characters in rejoin Re:(2)
Thanks, guys, for the answer. I didn't think about there being a datatyping problem, but that makes perfect sense now. >A tag! is meant to represent only one tag. If you want to have more than one >tag in an HTML element, you need to make a string. So it's very easy to >correct your function. Replace the line quoted above with: > > markup-string: rejoin ["" open-tag data/name close-tag]
[REBOL] New REBOL/Core Manual Re:
Try converting the files to MS Word 97 first and then save as HTML from Word. You will get messy looking HTML, but it may look OK. -Ryan >The HTML version of this manual will be coming soon. As it turns out, it's >not as easy as you would think to convert Framemaker files to HTML. Watch >the web site. > >Enjoy your reading, > >-Carl > > > >
[REBOL] What is REBOL good for? Re:(3)
You can install the /Core binary in your cgi-bin and use a shebang pointing to the binary. Of course, your scripts must be made executable. >> I really like how straightforward REBOL is when it comes to writing CGI >> programs. And REBOL is fast. Using /Core for CGI, pages update pretty >> quickly. >> > I'm not in web development so I'm a little hazy how this works. >Does the browser need to supprot REBOL, or is there a program running on >the server to interpret it, or something else?
[REBOL] What is REBOL good for? Re:
>Or for those >of you doing work with it, what sorts of programs have you had success >writing in REBOL? I really like how straightforward REBOL is when it comes to writing CGI programs. And REBOL is fast. Using /Core for CGI, pages update pretty quickly. Check out http://www.beosjournal.com All of the news articles there are updated using a combination of POP3 and CGI. The commenting system updates very quickly. Give it a try.
[REBOL] REBOL/Core and REBOL/View on BeBits
Over a year ago, someone at RT posted REBOL/Core on BeBits, the main software download site for the Be operating system. RT has not updated its offerings on BeBits and so I have taken it upon myself to put links to both /Core and /View on the site. You can find them at... http://www.bebits.com/app/1619 http://www.bebits.com/app/1620 I will update these pages as RT updates /Core and /View for the BeOS. I also placed several links there to useful information about REBOL (including REBOL Press.) I'm very pleased with the download rate so far. "Build it and they will come." -Ryan
[REBOL] The Industry Needs REBOL But Thinks it Wants Perl Re:(6)
Hey, this is a great idea! It's not like they're Apple and giving away free hardware. They're just giving away binaries. Throw in a few Dummies books and the price goes up, sure, but this is really a great idea. >yes. I think rebol should attact educational market before python beats them >to it! give it to >schools/colleges for free!!! > >Rishi >- Original Message - >From: <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Thursday, September 21, 2000 9:00 AM >Subject: [REBOL] The Industry Needs REBOL But Thinks it Wants Perl Re:(4) > > >> >> Hello: FYI >> I am designing an on-line class (intro to programming) >> for a local school district. >> Am using rebol as the language. >> Best first choice IMHO. >> Get 'em while they're young. :) >> -tim >> [EMAIL PROTECTED] wrote: >> >> > Now that smells like a good business plan, teach programming using REBOL. >$x >> > per person per lesson x times a week adds up well. >> > I am tempted to try this one out. >> > >> > --Ryan >> > >> > Ryan Cole >> > Programmer Analyst >> > www.iesco-dms.com >> > 707-468-5400 >> > >> > We are what we think. All that we are arises >> > with our thoughts. With our thoughts, we make >> > the world. --Buddha >> > >
[REBOL] parse or Re:(7)
Ahh, yes, of course, the reason for my dilemma in the first place. "Paragraphs" are much different animals than "lines." >I don't think that just breaking on {^/} solves the problem as posted. >The objective, as I read it, was to break on PARAGRAPHS (not lines) >where a paragraph is defined as the end of a sentence that concides >with the end of a line. In other words, there shouldn't be a break >between lines that contain two (or more) parts of a multiple-line >sentence.
[REBOL] parse or Re:(6)
Point well-taken. It seems I have forgotten the KISS law. -Ryan "Keep It Simple, Stupid." >So what? Seems the application that's going to use the block of paragraphs >could easily deal with the "" for an empty paragraph. To me, that's >preferable than trying to outguess the final character of every conceivable >paragraph!
[REBOL] parse or Re:(4)
Ahh, but this is not enough, because if the report has more than one newline character following a paragraph, you will end up with empty paragraphs. >> But what if I'm trying to parse a report and wish to make each >> paragraph a separate string within a block? > >Simple parsing with the /all refinement will do this in one step. The /all >refiinement disables all the default delimiters and uses only the supplied >string of characters to break apart the target string. In this case, we'll >use the control character "^/", end of line, commonly used to end a >paragraph. > >A console session follows that illustrates this. ( Note I've inserted an >extra "test" period within the first paragraph.) > >>> paragraphs: {First. paragraph.^/Second "paragraph."^/Third paragraph.} >== {First. paragraph. >Second "paragraph." >Third paragraph.} > >>> ; Now apply the simple parse/all with only the single break character >"^/" > >>> parse/all paragraphs "^/" >== ["First. paragraph." {Second "paragraph."} "Third paragraph."] > >end of console session. > >This seems to be just what is wanted. {}'s are used for the second item >because it included " 's. The period at the end of First is ignored, along >with all the other spaces, ", etc because the /all refinement disabled the >usual default break chars.
[REBOL] [ANN] News Site 2.5
News Site 2.5 (news-site.cgi), a CGI executable script written in REBOL which allows you to update a news headlines Web site by sending an e-mail to a POP account, can be downloaded at the following URL: http://www.bebits.com/app/1226/ News Site (news-site.cgi) is a CGI executable script which checks a POP e- mail account for new mail, verifies the e-mail is from a qualified contributor (or deletes the e-mail), converts the contents of the e-mail object (as understood by REBOL) into a "make object!" expression saved to a file. These "make object!" expressions are set up as news articles, including values for headlines, subheadlines, bylines, titles, body text in paragraphs, reference numbers, file names, and approval status. The script also creates a comments directory for each new article. When executed, News Site dynamically creates the front page of a news-oriented web site. Currently prints the following as text/html output: 1. html head and meta information. 2. stylesheet information. 3. banner information. 4. news headlines, bylines, articles, and article reference numbers. 5. a link to execute displaycomments.cgi, which renders the article again, comments already made on the article, and a form for posting a new comment. 6. upon execution, news-site.cgi updates an .rss (Rich Site Summary) XML file for the site. Known problems include: 1. parse problem with tilde "~" characters when parsing e-mail message body content for conversion to objects. 2. most recent articles are expected to show up in the tail end of a directory because of the file-naming scheme. This has proven true on all test systems with Windows NT and BeOS, but when used live on a Solaris machine the articles appeared out of order. -Ryan
[REBOL] linux help Re:(4)
Ahh, I understand now. But Monkey Linux is not multi-user and has no security. Monkey Linux is just a quick way to install linux anywhere MS-DOS resides so that you can use Linux. Now I can use REBOL, too, on my old laptop. >you are running as root? current dir is then not in >the path, to avoid accident wrong program starts (high >security needed..) > >login in as normal user should work with current dir.
[REBOL] same script, different permissions?
I have a script running in my cgi-bin which grabs information from e- mail message objects in a POP account and then creates and writes text files from the information. The script writes the articles to a sub- directory of the cgi-bin. The script is giving the files different sets of permissions, as follows... -rw-r- 1 www www 1067 Sep 14 11:09 2914160357.r -rw-r- 1 www www 2316 Sep 14 11:09 2914160359.r -rw-r- 1 www www854 Sep 14 11:10 2914160448.r -rw-r- 1 www www803 Sep 14 11:10 2914160449.r -rw-rw-r-- 1 www www733 Sep 14 11:10 2914160630.r -rw-r- 1 www www722 Sep 14 12:23 2914171950.r -rw-rw-r-- 1 www www737 Sep 14 12:45 2914174152.r -rw-rw-r-- 1 www www779 Sep 14 16:14 2914210819.r -rw-r- 1 www www596 Sep 14 20:05 2915005920.r any clue as to why that might be happening?
[REBOL] linux help Re:(2)
This worked. But it would not run rebol by simply typing "rebol" within the rebol directory. Strange. But now I have REBOL on my 486 laptop. Cool. >I will be able to help more with more information provided. I am >shooting in the dark, but is rebol binary included in your path? Try > > $ /rebol/rebol > >This should then run Rebol.
[REBOL] linux help
I installed Monkey Linux, a MiniLinux on my 486 laptop. The only user is root. I created a .profile in ~ which has set REBOL_HOME=/rebol as the environment variable. I have a directory /rebol containing the rebol binary. The rebol binary is chmod +x REBOL won't run. What am I missing? I have tried both libc5 and libc6 binaries. I'm new to linux. Did I screw up something basic? I just want to be able to run REBOL and vi on this old laptop so that I have portable REBOL. Thanks. -Ryan
[REBOL] Why are there no PDA ports of REBOL available? Re:
If a BeIA-based PDA surfaces, then REBOL "may" work by default since BeIA "is" BeOS. >However, I am worried about the fact that there are no ports to PDAs >available yet, not even to the most popular platforms, e.g., Palm and Psion. >I would like to carry REBOL around with me on a small pocket sized Psion >Revo machine ... anywhere, anyplace. Win CE seems irrelevant to me in >comparison, seen from the no. of machines sold.
[REBOL] eScribe Rebol Archive vs rebol.org Archive Re:(4)
would you be able to export just the rebol messages from Outlook? >I've got back to Aug 1999 in Outlook Express if that helps. > >IMHO If you go back much further than that, there isn't much of relevance to >v2.x of REBOL > >Cheers, > >Allen K > >- Original Message - >From: <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Friday, September 08, 2000 12:13 PM >Subject: [REBOL] Re: eScribe Rebol Archive vs rebol.org Archive Re: > > >> Hello [EMAIL PROTECTED] >> >> On 07-Sep-00, [EMAIL PROTECTED] wrote: >> >> However, Ryan, I noticed that the eScribe FAQ says you can import >> >> older messages into the system. Have you looked at doing this? >> >> This would be awesome if someone could make this happen. >> > >> > Good idea. I will look into this, but someone at RT would have to help >me >> > out (unless there is some way to retrieve all old messages >> > automatically?) >> > >> I have all the mail form 1-10-2000 to the present and can send as html if >> that is what is needed-let me know >> Regards >> -- >> The only thing that stops God from sending another flood is that >> the first one was useless. >> -- Chamfort >> JMS Trustee http://www.jms.org >> HP=http://www.sonic.net/~alanwall/ >> First computer solar powered vic-20 >> AmigaQNX-notAmigaNG=no good >> computers for people not suits >> sent via Yam ver2 on AmigaForever ver3 >> Be a Rebel get [EMAIL PROTECTED] >> UIN#=9391028 >> >> > >
[REBOL] eScribe Rebol Archive vs rebol.org Archive Re:
Here is info from the FAQ... We currently support reading in past archives from the following formats: Eudora Outlook Express UNIX mail Pegaus Mail ListSTAR Listserv archives Majordomo digests Even if your archive is in a different format, we might be able to import it. The imported messages will look like any other messages, and will therefore also be searchable. OK. Can someone tell me how to get the entire archive? -Ryan >However, Ryan, I noticed that the eScribe FAQ says you can import >older messages into the system. Have you looked at doing this? >This would be awesome if someone could make this happen.
[REBOL] eScribe Rebol Archive vs rebol.org Archive Re:
>However, Ryan, I noticed that the eScribe FAQ says you can import >older messages into the system. Have you looked at doing this? >This would be awesome if someone could make this happen. Good idea. I will look into this, but someone at RT would have to help me out (unless there is some way to retrieve all old messages automatically?) -Ryan
[REBOL] Code Security Re:(2)
More thoughts... 1. Remove all line feeds from the code so that the script is one long line. 2. Create a user.r file that renames all native 'words to gobbledygook. 3. Run a REBOL program against your script which replaces all native 'words with the substitutions from the user.r file. 4. Run a REBOL program against your script which replaces all the rest of the 'words with gobbledygook. Now you should have one long line of code that looks more like a base64 file attachment than a script, but it will run just fine. I'm sure there are more steps one could take to make it at least difficult for others to want to steal your code. -Ryan >Although it is not "secure," I have thought about a way to make it difficult, >at least, for others to understand your code. > >Using a text editor, use search and replace to change the 'words so that they >are hard to understand when you read them. For example, change... > >news-server: input >open-server: reform [rejoin ["np: open news://" news-server]] >do open-server > >to... > >Xz8hUjKLmhT89||hg~: input >Yn876asdfGXzeyg|adlfj: reform [rejoin ["POxj724xcUYxq|x|y|q7: open news://" >Xz8hUjKLmhT89||hg~]] >do Yn876asdfGXzeyg|adlfj > >Of course, keep a copy of the "readable" code for yourself, but distribute >the gobbledygook to everyone else. > >Hey, maybe someone could write up a code-replacement script for this? Then >run the script on the script itself. Hmm... > >-Ryan > >>Hi, >>New to scripting languages as a major tool, here. So >>my question is what are the general views about the >>security and protection (against copying) of code in >>Rebol. How do you make money with something which is >>seen in source form so easily? I guess its OK with CGI >>scripts where its all happening at your end and may be >>combining with a lot of other technology, but >>applications like data mining look so much more >>vulnerable??? >>Vivek >> >>__ >>Do You Yahoo!? >>Yahoo! Mail - Free email you can access from anywhere! >>http://mail.yahoo.com/ >> >> > >
[REBOL] Code Security Re:
Although it is not "secure," I have thought about a way to make it difficult, at least, for others to understand your code. Using a text editor, use search and replace to change the 'words so that they are hard to understand when you read them. For example, change... news-server: input open-server: reform [rejoin ["np: open news://" news-server]] do open-server to... Xz8hUjKLmhT89||hg~: input Yn876asdfGXzeyg|adlfj: reform [rejoin ["POxj724xcUYxq|x|y|q7: open news://" Xz8hUjKLmhT89||hg~]] do Yn876asdfGXzeyg|adlfj Of course, keep a copy of the "readable" code for yourself, but distribute the gobbledygook to everyone else. Hey, maybe someone could write up a code-replacement script for this? Then run the script on the script itself. Hmm... -Ryan >Hi, >New to scripting languages as a major tool, here. So >my question is what are the general views about the >security and protection (against copying) of code in >Rebol. How do you make money with something which is >seen in source form so easily? I guess its OK with CGI >scripts where its all happening at your end and may be >combining with a lot of other technology, but >applications like data mining look so much more >vulnerable??? >Vivek > >__ >Do You Yahoo!? >Yahoo! Mail - Free email you can access from anywhere! >http://mail.yahoo.com/ > >
[REBOL] REBOL Internet Chess? Re:
That sounds very cool. I'm game. Now that you've got my wheels spinning, would it be possible to develop a real-time chat application in REBOL? I'm not talking about a situation where you type a message, hit , and then send a string. I'm talking about sending ASCII AS IT IS TYPED to a port which is sent via tcp/ip to a terminal window (or a view layout?) The ASCII then appears in real-time, backspaces and all, on the receiving end. >I'm looking for chess game for my kids... that runs in View over the >Internet... where one player can play another player. Anything like that out >there? > >-Carl > >
[REBOL] Do Be View We Do
BeOS REBOL'ers! I have posted the first /View-powered application on BeBits at... http://www.bebits.com/app/1452 The application is called ShadeMaker and is essentially a GUI front end for Marco Nelissen's WindowShade. The script is set as executable and launches with a double-click. There's still a bug and I'm looking for help on that one. -Ryan
[REBOL] Over 70 REBOL Experimental Binaries Available Re:(2)
Still lookin' for the BeOS /View binary. 8-) >Hi Carl, > >just two comments: > >1) Hope Windoze version will be up anytime soon too :-) >2) I would also like to hope you will solve "what's new, what's got >fixed, known bugs" descriptions - it would be very handy ... > >Cool system anyway ... > >-pekr- > > > >
[REBOL] Easy to use Database function Re:
I use a system which may not be the best solution but it works in my head space. On my news Web site, the common denominator is the news article, including the headline, byline, body copy, etc. This then is the basic value to be stored. Each news article is saved in a text file as an object expression so that the values can be loaded and objects can be created on the fly. Each object expression has a "reference-id" which matches the name of the file. The "reference-id" is based on the time the file was created in digits (e.g. 27251762). Since file creation is automated, this assures there will never be a file or object of the same name (wait 1 is used to keep it incremental.) Articles can be commented on. Comments are saved in the same fashion, with their own reference-ids which match the name of the file containing the comments in an object expression. The comments relate to a specific article by being saved in a directory with the same name as the article that the comments reference. Of course, the comments directories are saved in an alternate directory separate from the path where the articles are saved. This creates a database using the file system, directories and files as the "cells" where data is stored. Like I said, I don't know if it is the best solution, but since data is kept in separate files, individual articles can be deleted from the "database" quite easily and there is no single, large file that must be loaded into memory each time the database is accessed. Data is sought out by simply reading a directory and looking for a reference ID. -Ryan > >I am building a web application server with rebol, and have had no reall >problems up until >now, that i want to implement a function I call pageid that is , a >form can have a page id >which is like A23-C0399 , the page id i then want to be the reference value , >and i want to >use a database type system to store the values. , is there a good function >that anyone has written >that allows easy adding, removal, modfication and retrieval of data from a >rebol type db . > >this would be handy in the fact that i could > >- use a form with a pageid to add a pageid >- use the function to easily add it to the database >- use the database to update the list page >- use the database to retreive if a pageid is present and if so retrive the >pageid's details. > >the information the db needs to hold should be anything, especially one line >sentences and >strings. > >any help would be muchly appreciated, > >aden > > > > >> > > > > > > > >I am building a web application server with rebol, and have >had no reall problems up until >now, that i want to implement a function I call >pageid that is , a form can have a page id> >which is like A23-C0399 , the page id i then want to be the >reference value , and i want to >use a database type system to store the values. , is there >a >good function that anyone has written >that allows easy adding, removal, modfication and retrieval >of >data from a rebol type db . > >this would be handy in the fact that i could > >- use a form with a pageid to add a >pageid >- use the function to easily add it to the >database >- use the database to update the list page >- use the database to retreive if a pageid is present >and >if so retrive the pageid's details. > >the information the db needs to hold should be anything, >especially one line sentences and >strings. > >any help would be muchly appreciated, > >aden > > > > >>
[REBOL] Need basic help Re:
Try this... >either find/match ask ["What OS? "] "1" > [get_file: join patch_number ["-" patch_revision ".tar.gz"]] >[get_file: join patch_number ["-" patch_revision ".zip"]] get_file: rejoin [patch_number {-} patch_revision {.zip}] >write %get_file read site/:get_file > >"site" is a previously defined url. The error message on this is: > >** Access Error: Port none not open. >** Where: write %get_file read site/:get_file > complete-url: rejoin [site get_file] retrieve-file: reform ["write" rejoin [{%} get_file] "read" complete-url] do retrieve-file
[REBOL] word: read url -- print word
The following works from the console but will not send output from a script to the browser. It will print the entire contents of the page in the console as expected, but the browser just sits thinking as if in a loop. Any ideas? -Ryan #!rebol -cs REBOL [] print "Content-Type: text/html^/" comments-reference: 2715121834 return-to-display: reform ["next-page: read" rejoin [{http:// www.beosjournal.com/cgi-bin/displaycomments.cgi?comments-reference=} comments -reference]] do return-to-display print next-page
[REBOL] cgi Re:(4)
Here is what I have discovered. Printing text/html output of the following... print {} ...passes a URL appended with "?article%2Dreference=27155544" creating a word REBOL cannot use. while... print {} ...passes a word REBOL can use. It seems the hyphen was causing a problem with my CGI. -Ryan > > >will pass a static value with a form > >> I need to >>figure out how to pass a static value with a form, one that is not generated >>or chosen by the submitter >> > >
[REBOL] cgi Re:(3)
will pass a static value with a form > I need to >figure out how to pass a static value with a form, one that is not generated >or chosen by the submitter >
[REBOL] cgi Re:(2)
Well, using... cgi-input: make object! decode-cgi system/options/cgi/query-string and then calling "comments-reference" using cgi-input/comments-reference from the url... http://www.beosjournal.com/cgi-bin/displaycomments.cgi?comments-reference= 2715121834 Worked! I can now view the comments page, although there are no comments yet and here is why: I need to send another reference value to another script which processes submitted comments. When I try to submit a comment, I get an error because the url ends up being as follows... http://www.beosjournal.com/cgi-bin/processcomments.cgi?article-reference= 2715121834?heading=First+comment&body=No+comment.&name=G&email=g%40g.mib As you can see, I try to pass an "article-reference" value by appending the url and then also try to pass form values along with the same query string, producing double "?" query string markers. I'm working on this. I need to figure out how to pass a static value with a form, one that is not generated or chosen by the submitter. -Ryan
[REBOL] adding data to hyperlinks, etc. Re:
In the interim while I haven't received any responses, I thought of a third solution, albeit I don't like it. The third solution is to have each news article rendered within its own form and to have its own submit button. The form can carry the article's reference number via the cgi object. This is probably the easiest solution, but I can't stand the thought of having so many submit buttons on a news headlines page. Perhaps I'll change the value of the submit button to be "!" so that it doesn't take up so much space. Otherwise, if anyone has an answer to my previous question I'm all ears. 8-) -Ryan >Hello. Before I progress any further, I need some advice. > >With my script News Site, the script saves news articles as object >expressions and loads them into memory before rendering a page based on the >values in the objects. One of the object values is a reference number to >differentiate the object from all others (since the objects are only object >expressions they are assigned to object words upon loading.) > >The next feature I want to add is a commenting system. I want the reader to >be able to click on a hyperlink for "comments" which will then execute a .cgi >script. The .cgi script will then render a page including all of the comments >people have posted in regards to the news article in question. The question I >have is, how do I pass a value to a script from a hyperlink so that the >script renders the correct set of comments? > >I have thought of another option, albeit more cumbersome. During the time the >main script creates object expressions for the news articles themselves, the >script could create a separate .cgi script just for that article. But how can >I write a script to a directory and then make the script executable all at >the same time? I'm thinking the web server will see the .cgi extension and >assign it executable status, but I'm not sure that is always the case. > >I hope you're understanding what I am writing. Your help is much appreciated. > >-Ryan > >
[REBOL] adding data to hyperlinks, etc.
Hello. Before I progress any further, I need some advice. With my script News Site, the script saves news articles as object expressions and loads them into memory before rendering a page based on the values in the objects. One of the object values is a reference number to differentiate the object from all others (since the objects are only object expressions they are assigned to object words upon loading.) The next feature I want to add is a commenting system. I want the reader to be able to click on a hyperlink for "comments" which will then execute a .cgi script. The .cgi script will then render a page including all of the comments people have posted in regards to the news article in question. The question I have is, how do I pass a value to a script from a hyperlink so that the script renders the correct set of comments? I have thought of another option, albeit more cumbersome. During the time the main script creates object expressions for the news articles themselves, the script could create a separate .cgi script just for that article. But how can I write a script to a directory and then make the script executable all at the same time? I'm thinking the web server will see the .cgi extension and assign it executable status, but I'm not sure that is always the case. I hope you're understanding what I am writing. Your help is much appreciated. -Ryan
[REBOL] An experiment with RTF Re:
Well, it all depends on HOW they will be updating the site and what is it on the site they will be updating? I've written a script which allows people to update a site of news headlines by sending an e-mail to an e-mail address. If you know WHICH content you want them to update, you can do the same. Here is my script: http://www.bebits.com/app/1226 The other way to do it is to set up a site with Web-based forms from which they can update content. >The situation I have is that I'm going to do up a web-site for my sister's >company. I want to be able to implement a consistent style for the site and >yet have my sister or her staff do the updates. Since they are not familiar >with Web pages (and I don't think they should have to be), I was looking for >some sort of automated process. I've done a lot of research on the web and I >haven't seen a simple effective solution to this problem - the grail of >content + presentation.
[REBOL] [ANN] 2KB News Reader 0.1.1 Re:(2)
I played around a bit. It seems when the nntp.r checks for messages associated with a newsgroup, it also includes messages which have "expired." This accounts for the "non-existant" messages for when you choose "N" for next message and you see nothing but the options again. I ran into a series of these messages, perhaps a half-dozen or more before the header and text of a message finally appeared again. As for the message count, that seems screwed up, too, because I always end up reading fewer messages than what the nntp.r returns. I'm not sure if trying to fix this would be more than just butting heads with nntp.r which may have some issues. >Pretty impressive. It's about time someone made some public use of NNTP.r. >I found one problem, it either reports the wrong number of messages >available or else it can't always find the next message. After 3 or so >messages, if I press "n" for next message, I just get the instructions again >for each time I press "n". > >Cheers, > >Allen K > >
[REBOL] REBOL/Core 2.3 Released! Re:(2)
They are there, for sure. You just have to enter your e-mail address, etc., to proceed. Or you can cheat and just go to... http://www.rebol.com/platforms.html Here is a direct link to the Windows version if that's what you're looking for... http://www.rebol.com/downloads/rebol031.zip >> REBOL/Core is available for download at >> http://www.rebol.com/downloads.html and > >No it aint. I cannot find it listed. So I don't know how you other guys got >it! > >Brett. > >
[REBOL] [ANN] 2KB News Reader 0.1.1 Re:(4)
Thanks for the input, Jeff. I'll work on updating my news reader with x-hdr functions. Yes, news servers do return very strange information. They are definitely part of the 'old Internet' when things were rather rough around the edges. > Boy, nntp.r really is in need of an update. Looking at > NNTP.r it's doing all sorts of dialecting things by > hand that would be a lot easier to do today in modern > REBOL with things like parse block. The whole thing > could be shrunk by at least a half. So many things > rattling around on our overly loaded wagon trains... > > :-) > > Hope that info may be useful on your projects. > > -jeff > >> As for the message count, that seems >> screwed up, too, because I always end up reading fewer messages than what >the >> nntp.r returns. >> >> I'm not sure if trying to fix this would be more than just >> butting heads with nntp.r which may have some issues. >> >> >Pretty impressive. It's about time someone made some >> >public use of NNTP.r. I found one problem, it either >> >reports the wrong number of messages available or else it >> >can't always find the next message. After 3 or so >> >messages, if I press "n" for next message, I just get the >> >instructions again for each time I press "n". >> > >> >Cheers, >> > >> >Allen K > >
[REBOL] [ANN] 2KB News Reader 0.1.1
Oops. Fixed a slight UI bug. The script now asks for a newsgroup up front and sets parameters right away. -Ryan REBOL [ Title: "2KB News Reader" Date:28-June-2000 Version: 0.1.0 File:%2KBnewsreader.r Author: "Ryan C. Christiansen" Email: [EMAIL PROTECTED] Owner: "Ryan C. Christiansen" Rights: "Copyright (C) Ryan C. Christiansen 2000" Tabs:4 Purpose: { Simple CLI news reader. } Comment: { Requires %nntp.r interpreter. News Reader options include: G - new group N - next message P - previous message S - post Q - quit } History: [ 0.1.0 [28-June-2000 "First version." "Ryan"] ] ] do %nntp.r print rejoin [newline newline newline "Welcome to the 2.16KB News Reader 0.1" newline newline "What is the name of your news server?"] news-server: input open-server: reform [rejoin ["np: open news://" news-server]] do open-server valid-options: ["G" "N" "P" "S" "Q"] option: copy "" display-options: func [ "display newsreader options and seek input" ][ print rejoin [newline "OPTIONS:" newline "G - new group" newline "N - next msg" newline "P - previous msg" newline "S - post" newline "Q - quit" newline newline "What next?"] clear option option: input ] print "Name of newsgroup?" newsgroup-name: input group-stats: insert np [count from newsgroup-name] msg-list: copy [] for i group-stats/2 group-stats/3 1 [append msg-list form i] msg-position: 0 print rejoin ["There are " group-stats/1 " messages on the server for this newsgroup."] forever [ display-options either error? try [find/any option valid-options ][ print rejoin ["invalid choice - try again" newline "OPTIONS:" newline "G - new group" newline "N - next msg" newline "P - previous msg" newline "S - post" newline newline "What next?"] clear option option: input ][ switch option [ "G" [ print "Name of newsgroup?" newsgroup-name: input group-stats: insert np [count from newsgroup-name] msg-list: copy [] for i group-stats/2 group-stats/3 1 [append msg-list form i] msg-position: 0 print rejoin ["There are " group-stats/1 " messages on the server for this newsgroup."] ] "N" [ either msg-position = group-stats/1 [ "You're already at the last message." ][ msg-position: msg-position + 1 ] next-message: reform [rejoin ["msg-list/" msg-position]] new-message: reform [rejoin [{msg-to-display: insert np [headers-bodies of } next-message { from "} newsgroup-name {"]}] ] do new-message print msg-to-display ] "P" [ either msg-position = 1 [ "You're already at the first message." ][ msg-position: msg-position - 1 ] previous-message: reform [rejoin ["msg-list/" msg-position]] new-message: reform [rejoin [{msg-to-display: insert np [headers-bodies of } previous-message { from "} newsgroup-name {"]}] ] do new-message print msg-to-display ] "S" [ print "What would you like to say? ( will send your message.)" body: input msg-id: insert np [post body to newsgroup-name] ] "Q" [ quit ] ] ] ] BeOS Attributes
[REBOL] [ANN] 2KB News Reader
I just had the most enjoyable one-hour scripting experience writing a news reader in REBOL. The script is attached if you'd like to try it out. -Ryan REBOL [ Title: "2KB News Reader" Date:28-June-2000 Version: 0.1.0 File:%2KBnewsreader.r Author: "Ryan C. Christiansen" Email: [EMAIL PROTECTED] Owner: "Ryan C. Christiansen" Rights: "Copyright (C) Ryan C. Christiansen 2000" Tabs:4 Purpose: { Simple CLI news reader. } Comment: { Requires %nntp.r interpreter. News Reader options include: G - new group N - next message P - previous message S - post Q - quit } History: [ 0.1.0 [28-June-2000 "First version." "Ryan"] ] ] do %nntp.r print rejoin [newline newline newline "Welcome to the 2.16KB News Reader 0.1" newline newline "What is the name of your news server?"] news-server: input open-server: reform [rejoin ["np: open news://" news-server]] do open-server valid-options: ["G" "N" "P" "S" "Q"] option: copy "" display-options: func [ "display newsreader options and seek input" ][ print rejoin [newline "OPTIONS:" newline "G - new group" newline "N - next msg" newline "P - previous msg" newline "S - post" newline "Q - quit" newline newline "What next?"] clear option option: input ] forever [ display-options either error? try [find/any option valid-options ][ print rejoin ["invalid choice - try again" newline "OPTIONS:" newline "G - new group" newline "N - next msg" newline "P - previous msg" newline "S - post" newline newline "What next?"] clear option option: input ][ switch option [ "G" [ print "Name of newsgroup?" newsgroup-name: input group-stats: insert np [count from newsgroup-name] msg-list: copy [] for i group-stats/2 group-stats/3 1 [append msg-list form i] msg-position: 0 print rejoin ["There are " group-stats/1 " messages on the server for this newsgroup."] ] "N" [ either msg-position = group-stats/1 [ "You're already at the last message." ][ msg-position: msg-position + 1 ] next-message: reform [rejoin ["msg-list/" msg-position]] new-message: reform [rejoin [{msg-to-display: insert np [headers-bodies of } next-message { from "} newsgroup-name {"]}] ] do new-message print msg-to-display ] "P" [ either msg-position = 1 [ "You're already at the first message." ][ msg-position: msg-position - 1 ] previous-message: reform [rejoin ["msg-list/" msg-position]] new-message: reform [rejoin [{msg-to-display: insert np [headers-bodies of } previous-message { from "} newsgroup-name {"]}] ] do new-message print msg-to-display ] "S" [ print "What would you like to say? ( will send your message.)" body: input msg-id: insert np [post body to newsgroup-name] ] "Q" [ quit ] ] ] ] BeOS Attributes
[REBOL] CGI frustration Re:
Never mind. Sorry.
[REBOL] CGI frustration
Attached is a script which I am able to run successfully on a local machine, but when I configure it for my web space, it doesn't run. Here's some info: I upload the script and chmod 755 There is one directory which must be accessible to the script. I give that directory "articles/" chmod 777 I use the correct shebang #!rebol -cs My absolute path is correct. I call the script using I have other REBOL scripts running just fine in this web space, which means I have the correct binary uploaded and CGI does, in fact, work. I'm at a loss. If you care to help me out, change the configuration settings in the script and then upload the script along with the stylesheet.html document to a cgi-bin. You will also need to create a readable/ writeable directory named "articles/" in the top directory within the absolute path of your web space. Then, of course, you will have to send a couple of e-mails to a pop account. #!rebol -cs REBOL [ Title: "News Site" Date:07-June-2000 Version: 2.0 File:%news-site.cgi Author: "Ryan C. Christiansen" Email: [EMAIL PROTECTED] Rights: "Copyright (C) Ryan C. Christiansen 2000" Purpose: { INPUT: A CGI executable script which checks a POP e-mail account for new mail, verifies the e-mail is from a qualified contributor (or deletes the e-mail), converts the contents of the e-mail object (as understood by REBOL) into a "make object!" expression saved to a file. These "make object!" expressions are set up as news articles, including values for headlines, subheadlines, bylines, titles, body text in paragraphs, reference numbers, file names, and approval status. OUTPUT: A CGI executable script which dynamically creates the front page of a news-oriented web site. Currently prints the following as text/html output... -html head and meta information. -stylesheet information. -banner information. -news headlines, bylines, articles, and article reference numbers. } Comment: { The "make object!" expressions created by this script are used to create text/html output which is a news-oriented Web page. The style of the text/html output is dependent upon a cascading style sheet which is loaded upon execution. Your browser must support cascading style sheets in order for the script to display the articles properly by default. } History: [ 1.0 [ 13-May-2000 {Made scoop.cgi a public release} "Ryan" ] 2.0 [ 22-June-2000 {Renamed to News Site. New features include: -articles are now saved as object expressions instead of as html-formatted text files. Object expressions including the following variables: 'headline 'subheadline 'article-post-date 'byline 'title 'body (with each paragraph as a separate string in a series of strings) 'reference-number 'obj-file-name 'approval -the resultant text/html output is now entirely dynamic. New features include: -alternating styles -dynamic banner creation -dynamic html and meta creation } "Ryan" ] ] ] ; - ; -- CUSTOMIZATION AND CONFIGURATION SECTION -- ; - pop-username: "username" pop-password: "password" pop-mail-server: "mail.domain.dom" absolute-path: "absolute/path/" number-of-headlines: 5 unapproved-article-folder: "articles/" approved-article-folder: "articles/" headline-stylesheet: %stylesheet.html page-title: "The News and Mail" meta-keywords: {REBOL Internet Messaging Language scripting Web development} publication-name: "The News and Mail" copyright-info: {© Ryan C. Christiansen, 2000} page-width: 480 headlines-width: 480 ;-- listing of e-mail addresses which are valid for posting news reporters: make object! [ total-reporters: 3 reporter1: make object! [ email-address: [EMAIL PROTECTED] full-name: "Ryan C. Christiansen" person-title: "Editor-in-Chief" ] reporter2: make object! [ email-address: [EMAIL PROTECTED] full-name: "Ryan C. Christiansen" person-title: "Editor-in-Chief" ] reporter3: make object! [ email-address: [EMAIL PROTECTED] full-name: "Ryan C.
[REBOL] sizeof values Re:
'size? will work with a file or a URL. If you save the value to a file you can read its size. >> write %testone.test "" >> size? %testone.test == 0 >> write %testtwo.text "0" >> size? %testtwo.text == 1 >> >Hello: >Does rebol have a feature to check the size in >bytes of a value? >TIA >-Tim
[REBOL] Parsing tab delimited text files Re:
>> probe tab #"^-" == #"^-" page: read/lines %textfile.txt foreach line page [ line: parse/all line "^-" ] > I am parsing a number of tab delimited text files. > > For reasons unknown this doesn't work: > > page: read/lines %textfile.txt > foreach line page [ >line: parse/all line tab > ] > > Instead, I do this: > > parsetab: func [line] [ >replace/all line tab "|" >line: parse/all line "|" > ] > > foreach line page [ >line: parsetab line > ] > > Why does the first way not work? > > >
[REBOL] teeny bits of time
Wouldn't this be cool? >> >> current-time: now/time == 20:37:33 >> print current-time/hour 20 >> print current-time/minute 37 >> print current-time/second 33 >> print current-time/millisecond 14 >> print current-time/microsecond 57 >> print current-time/nanosecond 98 Any idea if this would even be possible? -Ryan
[REBOL] solved (was detach-image: func (was: %detach.r ) ) Re:(9)
>Perhaps best to find "image/jpeg" and then find the blank line before >the >start of the base64 with "^-^-" ? This would suit my purposes fine, but it would not do for a universal function. >Can we find the end of the base64 by looking for the blank line after? It seems the blank line before and the blank line after are pretty standard. I'm not sure about meeting the MIME standard. >I suppose, we would like to get the image file name as well? Not necessary for me, but again a universal function should satisfy all possibilities. The following comes from rfc1521 at http://www.cis.ohio-state.edu/htbin/rfc/rfc1521.html The reference is confusing, because it first says that line breaks cannot be relied upon, but then the example it gives of a multi-part message always shows line breaks before each new base64 encoding. Perhaps someone can come up with a good parsing scheme based on the following? -- "The output stream (encoded bytes) must be represented in lines of no more than 76 characters each... Special processing is performed if fewer than 24 bits are available at the end of the data being encoded. A full encoding quantum is always completed at the end of a body. When fewer than 24 input bits are available in an input group, zero bits are added (on the right) to form an integral number of 6-bit groups. Padding at the end of the data is performed using the '=' character. Since all base64 input is an integral number of octets, only the following cases can arise: (1) the final quantum of encoding input is an integral multiple of 24 bits; here, the final unit of encoded output will be an integral multiple of 4 characters with no "=" padding, (2) the final quantum of encoding input is exactly 8 bits; here, the final unit of encoded output will be two characters followed by two "=" padding characters, or (3) the final quantum of encoding input is exactly 16 bits; here, the final unit of encoded output will be three characters followed by one "=" padding character. "Because it is used only for padding at the end of the data, the occurrence of any '=' characters may be taken as evidence that the end of the data has been reached (without truncation in transit). No such assurance is possible, however, when the number of octets transmitted was a multiple of three. "The following guidelines may be useful to anyone devising a data format (Content-Type) that will survive the widest range of networking technologies and known broken MTAs unscathed: "(1) Under some circumstances the encoding used for data may change as part of normal gateway or user agent operation. In particular, conversion from base64 to quoted-printable and vice versa may be necessary. This may result in the confusion of CRLF sequences with line breaks in text bodies. As such, the persistence of CRLF as something other than a line break must not be relied on. "(2) Many systems may elect to represent and store text data using local newline conventions. Local newline conventions may not match the RFC822 CRLF convention -- systems are known that use plain CR, plain LF, CRLF, or counted records. The result is that isolated CR and LF characters are not well tolerated in general; they may be lost or converted to delimiters on some systems, and hence must not be relied on. What follows is the outline of a complex multipart message. This message has five parts to be displayed serially: two introductory plain text parts, an embedded multipart message, a richtext part, and a closing encapsulated text message in a non-ASCII character set. The embedded multipart message has two parts to be displayed in parallel, a picture and an audio fragment. MIME-Version: 1.0 From: Nathaniel Borenstein <[EMAIL PROTECTED]> To: Ned Freed <[EMAIL PROTECTED]> Subject: A multipart example Content-Type: multipart/mixed; boundary=unique-boundary-1 This is the preamble area of a multipart message. Mail readers that understand multipart format should ignore this preamble. If you are reading this text, you might want to consider changing to a mail reader that understands how to properly display multipart messages. --unique-boundary-1 ...Some text appears here... [Note that the preceding blank line means no header fields were given and this is text, with charset US ASCII. It could have been done with explicit typing as in the next part.] --unique-boundary-1 Content-type: text/plain; charset=US-ASCII This could have been part of the previous part, but illustrates explicit versus implicit typing of body parts. --unique-boundary-1 Content-Type: multipart/parallel; boundary=unique-boundary-2 --unique-boundary-2 Content-Type: audio/basic Content-Transfer-Encoding: base64
[REBOL] rebol for dummies Re:(3)
I'm glad to see a Dummies book on REBOL because it will lend credibility to the language. So far, I have only been able to make others "somewhat interested" in the language by showing them what can be done with it. But they haven't yet bothered to try it for themselves (preferring instead to use perl, python, etc.) At least with the Dummies book they might begin to realize they are missing out on something, which they are. I can't wait for the day I look at a web development job listing and see that knowledge of and experience with REBOL is required. I'm there! -Ryan >I >believe it to be one of the best and most exciting books I've ever > written >and feel very, very good about the job I did. I have a passion for REBOL >and >it comes through in my book. This guide will certainly be helpful in >learning REBOL, and it includes some unique coding that I hope will > engender >spurts of creativity from many in the REBOL community.
[REBOL] /content-type and rebol/core (was %detach.r) Re:(3)
Thanks. In light of all of this I think I am going to re-write %detach.r to specifically look for image/jpeg, image/gif, etc., content -types since my intended purpose is to be able to detach images from an e-mail and ignore all other attachments. It will be "simpler" just to have the parser look for one or more of a set of specific content-types and, if the result is true, index the position of the content-type statements and then find the base64 information and decode. If I rely on the more general %detach.r as it is already written, I suspect I may run into other variations which will force me to take those variations into account, as well. >Thanks Ryan I received the message. It looked fine in Outlook. >Looking at the boundary lines and headers it seems that your Be email client >has created two attachments. >One for the image and one for the Be operating system attibutes for that >file and seperated them with boundaries. It has then wrapped both of these >in a different boundary to make it one attachement at the highest email >level. The problem, I think, is that detach.r doesnt realise this is >possible. But I do not know enough about the protocol to know if this is >correct. > >However I did get the image saved out by doing the following. > >mails: read pop://bhandley. >; your message was the first so >m: import-email mails/1 ; import the relevent email >detach-results: detach import-email m/content; treat content as message >print ["Filename is: " detach-results/1] >write/binary detach-results/1 detach-results/2 > >Hope it helps. >Brett. > >- Original Message - >From: <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Monday, June 12, 2000 8:54 AM >Subject: [REBOL] /content-type and rebol/core (was Re: %detach.r) > > >> OK. The newer version of %detach.r worked fine with the Windows NT/ >> Pegasus e-mail message. But it is having trouble with the BeOS R5 Pro/ >> BeMail e-mail message. >> >> Here are the /content-type and /content results of using 'probe to view >> email objects as REBOL sees them. As you can see, the "boundary=" >> statement as read by REBOL/core produces something different than what >> the e-mail header declares. >> >> Here is the /content-type as produced by 'probe >> >> Content-Type: "multipart/mixed; boundary=_--_BeOS.rmp.96" >> >> >> >> Here is the actual beginning of the email /content as produced by >> 'probe >> >> Content: {This is a multi-part message in MIME format. >> --_--_BeOS.rmp.960760927_--_ >> Content-Type: multipart/x-bfile; >> ^-boundary="++BFile111399423249++" >> >> >> >> As you can see, the parsing routine within REBOL/core found the first >> line in /content which contains "--" and copies the line past the "- -" >> and only up to the "6" and then quit, as follows... >> >> _--_BeOS.rmp.96 >> >> Any suggestions? Does REBOL/core for BeOS need to be fixed? Or is Be, >> Inc., not adhering to some e-mail message standard? >> >> -Ryan >> > >
[REBOL] /content-type and rebol/core (was Re: %detach.r)
OK. The newer version of %detach.r worked fine with the Windows NT/ Pegasus e-mail message. But it is having trouble with the BeOS R5 Pro/ BeMail e-mail message. Here are the /content-type and /content results of using 'probe to view email objects as REBOL sees them. As you can see, the "boundary=" statement as read by REBOL/core produces something different than what the e-mail header declares. Here is the /content-type as produced by 'probe Content-Type: "multipart/mixed; boundary=_--_BeOS.rmp.96" Here is the actual beginning of the email /content as produced by 'probe Content: {This is a multi-part message in MIME format. --_--_BeOS.rmp.960760927_--_ Content-Type: multipart/x-bfile; ^-boundary="++BFile111399423249++" As you can see, the parsing routine within REBOL/core found the first line in /content which contains "--" and copies the line past the "--" and only up to the "6" and then quit, as follows... _--_BeOS.rmp.96 Any suggestions? Does REBOL/core for BeOS need to be fixed? Or is Be, Inc., not adhering to some e-mail message standard? -Ryan
[REBOL] %detach.r Re:(5)
You're correct. I obtained %detach.r from the rebol.com site. The script at rebol.com is dated 9-June-1999 while the script at rebol.org is dated 15-Sep-1999. I guess someone needs to update the script at rebol.com >I think http://www.rebol.org/email/detach.r may be different to what you >have.
[REBOL] %detach.r Re:(4)
I take this back. I'm sure most MIME headers conform to the standard. I'm giving the RFC 1521 link you gave me a good read so that I can get a clue as to what may be going on. Thanks. >In parsing the /content of an e-mail object! I suspect there may be as >many different ways of presenting the boundary message as there are e- >mail clients across operating systems.
[REBOL] %detach.r Re:(3)
The %detach.r script had problems with messages sent from the following... 1. BeOS 5 Pro with BeMail e-mail client 2. Windows NT 4 with Pegasus e-mail client My suspicion is %detach.r hasn't been tested against very many e-mail clients (the author isn't to blame for this.) In parsing the /content of an e-mail object! I suspect there may be as many different ways of presenting the boundary message as there are e- mail clients across operating systems. It would be interesting to know what kind of similar hang-ups the REBOL team ran into when designing the 'email object to begin with. Currently, %detach.r and the accompanying %attach.r are the only resources/examples available concerning e-mail attachments and REBOL. Perhaps persons using the beta version of /command have more or better resources concerning attachments than /core users? Perhaps there is a global 'detach function available? -Ryan >I would suggest you learn about MIME, it will give a better > understanding. >(It will help you recognise and fix poorly constructed mime messages > too, like the one you presented)
[REBOL] Re: %detach.r
OK, making the change and running the script produced the following result: >> detach msg2 starting decoding process... Boundary string: _--_BeOS.rmp.960760 Found message attachment; remaining length: 10312 Found message attachment; remaining length: 15 breaking... attachents finished == [none {Content-Type: multipart/x-bfile; ^-boundary="++BFile111399423249++" }] The script broke without decoding attachments. Following is msg2/ content... This is a multi-part message in MIME format. --_--_BeOS.rmp.960760927_--_ Content-Type: multipart/x-bfile; boundary="++BFile111399423249++" --++BFile111399423249++ Content-Type: image/jpeg; name="freedotbedotcom.jpg" Content-Transfer-Encoding: base64 /9j/4AAQSkZJRgABAgEASABIAAD// gAmRmlsZSB3cml0dGVuIGJ5IEFkb2JlIFBob3Rvc2hv cKggNS4w/+4ADkFkb2JlAGRAAf/ bAIQAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB AQEBAQEBAQEBAQEBAQEBAQICAgICAgICAgICAwMDAwMDAwMDAwEBAQEBAQEBAQEBAgIBAgI D AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD/ 8AAEQgA MwBlAwERAAIRAQMRAf/dAAQADf/ EAaIGAgMBAAcIBgUECQMKAgEACwEA AAYDAQEBBgUEAwcCCAEJAAoLEAACAQMEAQMDAgMDAwIGCXUBAgMEEQUSBiE H EyIACDEUQTIjFQlRQhZhJDMXUnGBGGKRJUOhsfAmNHIKGcHRNSfhUzaC8ZKiRFRzRUY3R2M o VVZXGrLC0uLyZIN0k4Rlo7PD0+ MpOGbzdSo5OkhJSlhZWmdoaWp2d3h5eoWGh4iJipSVlpeY mZqkpaanqKmqtLW2t7i5usTFxsfIycrU1dbX2Nna5OXm5+jp6vT19vf4+ foRAAIBAwIEBAMF BAQEBgYFbQECAxEEIRIFMQYAIhNBUQcyYRRxCEKBI5EVUqFiFjMJsSTB0UNy8BfhgjQlklM Y Y0TxorImNRlUNkVkJwpzg5NGdMLS4vJVZXVWN4SFo7PD0+ PzKRqUpLTE1OT0laW1xdXl9ShH V2Y4doaWprbG1ub2Z3eHl6e3x9fn90hYaHiImKi4yNjo+ DlJWWl5iZmpucnZ6fkqOkpaanqK mqq6ytrq+v/aAAwDAQACEQMRAD8A2g+gOgMJ81MN2735312x8sZN01Hy0+afTm2dsdM/ Nf5g /GHrPYvWnxe+W3dPxh682/t7rv41d5dT7Xr8jlNtdPw5vN5nL0+TzeRz+ XrT93Hjkx2OoPde 6Hb/AIbT+Ov/AD8b5/8A/p2L+ab/APdke/de69/w2n8df+fjfP8A/wDTsX803/7sj37r3Xv + G0/jr/z8b5//APp2L+ab/wDdke/de69/w2n8df8An43z/wD/AE7F/NN/+7I9+ 691Gqf5bnxy plDP2R8/wCbf9vYP5p5/6F+YzH8e7Iuo9aNfLj0k8j/Lr6Da/wDDO0vn4sovaKf+a7/ NMVHP HGtvl5Iykn/X9qook/0VDp/1fPrR1UwRq6SsXwQ6IhqTR5Pf38wGnlB0rMn81n+ay0bH/ En5 aCMX/qGI/wBf2sbb42TxImBX0qK/8e6bEtCUdaH8+pNV/L/6OXUYOyvn/YfQ/ wDDrP8ANRIP 1+h/2bR7g2+vNx7olpCQNQz9v/Q3Vix8umCf4F9NR3t2X8/rggj/ALGrfzUyLXsb/ wDOVjHg f059qBY2xIx/P/obpoyP/q/4rpNV/wAHepKcnx9nfzAb8+kfzUf5qbaVt+ rj5RuSbj6e1ke2 WTcV/wCND/oPpvxpK0B/1fs6Q2X+HPXFJFI0HZ3z+DAWQ/8ADp/81Zit+QSB8lJRqI+lxb/ e /ZhBsm2ORqXH+mH/AFtHTT3EwBoc/wCr+j0Cu0dpbtze9vkJ8TK35DfMcdNdY4f4c/ J3bccP yt+SKdxNku9ar509Q726fyHyZOTb5UVPRiZb467f3nR49dzpkYNytVU7ZV9uyrt+NP8AuWy / fX0ufpvB101DjXTSvieufirXyp1r6qb6XX/omrTWh9K1pp/yU8+v/9Db5/lp/wDZOvY3/i/ / APNi/wDhpvzI9+691rN1S7K+V/8AMV+S+1PkFub5Ddk0z97dobX6X+ PHU8tbW5jtqXB9j5zB Y3ZDbj3Pnl2l1RsjbGydsx5LO1c70NPHjaapmiq6NqZBJAB+ n3nmjdod0luZlNxIsUEdSZaS EBNTNpjVUWrk0GkEhlpnujE2++0X3ava7d/bna+ W9slHL9jPue8bgFWPbxLZRSvdeDBF9RuF 1PdTmG1jUSuZ3iR4ZhKSp6KD4SfD/cu4ct1TS/Fv4Jbj3hjaedavpPpP+Yt2dn/lVt/+ GxVE mVGLG9MBt3a27d7Yyza8Vl6jD4yKRV+6r/ A6sD9OXthlleyGzbY1yozFFfO1yKcaa1VWcfwu VX+JqHqAbn32959r22z5ul91+ f7bZpWBXc9z5OsYdhm1kCPX9NLNPb20mKT26XE5UnwoNakE BfjRsXL/AAk/nF9UfHvavcG9s/1pk5aikqtu5/ P1FFX0uD7E6T3NnNp9f9n7ewtbLteo3htL JzYmS8EEdNPLDSVUUVMsixRINptn2Dnmy2yG/ka0OCpNDR4mKpIoOnWp0nAAJCkAA0Eh+6O / 2fvr9yvm73H3bkuxt+aIgGWaGIMjS2e5wRXF3YzSqJxbXCC4HcxdVaaJ3lKl3Mb/ADf+ uf8A RD8kPgZUdZdqfJXZUHyj+Udbtru3FYb5VfJD+ B7nw24ewOpoqygwmFru0a3G9d0VHSbryNPQ 0u2o8PR0NNUCKGFEgpRB0M9nNwG78s+ 4C7ptO2TttW1B7ZmsbPUjLFcEFmEAaUkohYzGRmIq SSzavn79yYHsN75O+ivruJb2+KzBbiYB1Lw4p4lEADMAE0gA0AwKY/5v+ x9zfy4utumvlL8Q +/fkF1/uOn7coOutydcdg/ IburvXrfsPG5raG9d1Q1WZ2l3lvjseKurcVJs407Qxy08H2VZN Knjq4oJRv2cvbT3J3Pe+ VOcNg264tjZmZJorS2tZoWWSNCFktooSA3iVqQTqUA1QsOre5Ed3 ybZbXv8Ay7ul1FcC5EbRNNLLHKGR27klZwSNNPShqAGAPV8GOXK7kwmBzVZt2p25kc3gcFl 8 jt6rhaSbb1Zk8ZSV2QxFVUPg/wByfGVM7wMbKWdPov0ECS+ Faz3ECXIlijkZVcfjCsQGA1cC AD9h6mCFpJ4IJWiKSOikqeKkgEg44g1HWOKKOWV8fkqQVCqjCCZ6OVpIlFzpjc4JEMThDbk 2 It9feyWUCWJ6GuRXj9vd1cCpKuK+n+qnU58Q8a3SJDTW/bApgLC3Ho/gpIP0FvbYmDHJ7/t / 6G6toI+zpO10CglTTjki4+zY8Aj+m3XHBH+uPamNiaENn7f+h+mmFMU/1fs6C/ dWUx2JWSas gWNQSAWxlTISDYGwi2dUtbkX4Ps4tIpJqBGz/pgP8Mg6TOypVmx/q+ zoru9u2dpUSTJ9rXVZ DWWOk2fuGq1MFPpPh6qrAALgXsbX9iqx2m7eh1qB85EH/awOi6e8hFagkf6Un/ nw9Ef657Nx H+zNfMjcH93Mn9l/su/8tPDfYf3Xz33Ov/TF/Niyf338M/0Y/e+Lx8eX+G+LV6PudXo9t/ um b+tXgfVL4n7s118RKf22jTq8enzprr56ad3TX1kf7u8Tw20/UafhPHRWtNFfzpTyr5df/ 9Hb 5/lp/wDZOvY3/i//APNi/wDhpvzI9+691pZdy7+3r1d80O9OxOuN0ZjZm+NpfJnu/ Lba3RgK s0mUxVaOzd4UzyQS2eKamq6Oolp6mnmSSmq6WaSCeOSGSRGxfvrm4s9+ 3G6tZmjuEu5SrDBB 8Rv8IwQcEEgggkdfSdyTy9sfNnsfyDy1zNtMN9sN5yttcc8Ey6o5F+ htmAIwQysFdHUq8cir JGyuqsLJfh98wflt8l+7KyoGc+N/VEeyNo5rtzv35Ur8d+p8f2Fs7qvaS4+ Lf27n3M23Kqmq 92Z2hqlpIo0pArNO8uhKenlMYq2TfN63W/Y+ JaQCNDLNceBGHSNaa21aaaiDQY860oDTGL3o 9mPZ32u5FhjNhzPu7X95Ft+07D++Nwezub+41m0t/A8ZWW3iZTIxMlQFCamkkUMHnSvc+D+ S v86fYfdmysDW4fbPYPyHTL7dxk9MI8k+ 38DseqwVLnMpRQRL9jkc5jNvfxauhOv7SWplR5JP G0rJrC/j3Xn233C3jKwy3VVHnQJSpHkSF1EeRJyePQk555Iv/a/7jvMHIu+bik+ 67dy2Y5pA 1U8aW6WVoo2J7kieb6eJseIqIVVdQQWZfz4sbPme6v5UuHpc1l9tVWX+VL4um3Jt84tc/ t2p yO9OjaODPYE5zF5zCDNYa
[REBOL] Session IDs Re:
Or you could create a session ID based on the date and time, as follows... time-in-digits: func [ "convert the date and time from 'now' into a string of digits" sun-dial [date!] "the current date and time from 'now'" ][ year: to-string sun-dial/year month: to-string sun-dial/month if (length? month) < 2 [insert month "0"] day: to-string sun-dial/day if (length? day) < 2 [insert day "0"] current-time: sun-dial/time hour: to-string current-time/hour if (length? hour) < 2 [insert hour "0"] minutes: to-string current-time/minute if (length? minutes) < 2 [insert minutes "0"] seconds: to-string current-time/second if (length? seconds) < 2 [insert seconds "0"] rejoin [year month day hour minutes seconds] ] >> file: time-in-digits now == "2610224640" >> file: to-file join file ".sid" == %2610224640.sid This works fine so long as you do not need to create more than one session ID during the same exact second. It also allows you to recognize which session IDs were created most recently (they will always appear at the tail of the directory.) BTW: Is there any way to make REBOL output fractions of a second? (tenths, hundredths, thousands, etc., of a second.) -Ryan >Now comes the tough part. I could not figure an easy way to include another >script to record the data (it can be writing to as many as 45 different >lists) since I'm dependant on the person filling in the form deciding >everything is correct and clicking on a 'continue' button. > >My solution? I decided to create a session ID, save the data in a file of >this name, then call the last script and pass the session ID to it. Lots of >good applications for SIDs. This works great and I'm sharing the code with >you folks in hope of some helpful suggestions of making it even better. If >not (it already works fine), well maybe somebody will learn something >(possibly, even me). > >Here's the code: >- > >letter: "abcdefghijklmnopqrstuvwxyz" > >random/seed now > >l1: pick letter random 26 >l1: join l1 pick letter random 26 >l2: pick letter random 26 >l2: join l2 pick letter random 26 >l3: pick letter random 26 >l3: join l3 pick letter random 26 >l4: pick letter random 26 >l4: join l4 pick letter random 26 > >file: join l1 random 100 >file: join file l2 >file: join file l3 >file: join file random 100 >file: join file l4 >file: to-file join file ".sid" ; do all this to get > ; a REALLY unique SID > >save file data > >call: join "/cgi-bin/address3.r" file > >print {CONTINUE.}; clicking on CONTINUE passes info > >-- > >The SID call will look something like >/cgi-bin/address3.r?wu258907oitg169005zu.sid > >The called script reads in the data file name via the system/script/ args >object, gets the file, and deletes it to avoid cluttering up your system. It >then processes and writes/appends to the proper address file or files. > >I'll have the entire thing up where anyone can look at it shortly. > >--Ralph Roberts > > >
[REBOL] rebol for dummies
Well, it looks like REBOL is finally going to hit the big time. There is going to be a "Dummies" book out in September. 8-) http://www.amazon.com/exec/obidos/ASIN/0764507451/o/qid=960652424/sr=8- 2/ref=aps_sr_b_1_2/103-6443163-7540649 -Ryan
[REBOL] Does rebol support the serial port? Re:
I was thinking the same question. I was hoping to write my own driver for my digital camera (unsupported in the BeOS) using REBOL. >I was hoping Rebol supports the serial port. I have a device control app in >mind and I figure Rebol will be perfect for my needs *if it does serial >ports*. But if not, I'll get some other program to connect serial with >TCP/IP. > >At the moment I'm interested in WinNT, Win95, Win98 and Linux. > >? > >Brett. > >
[REBOL] parsing by period and newline Re:
As a follow-up... would it make sense to do the following? article-info: msg/content end-of-paragraph: rejoin [{.} newline] replace/all article-info end-of-paragraph {~} and then parse the resultant string by the tilde character? (or am I adding an extra, unecessary step to the process?) -Ryan >;This parsing routine... > > >breakdown-content: func [ > "breakdown an e-mail content field into its parts" > msg [object!] "e-mail message" >][ > article-info: msg/content > end-of-paragraph: rejoin [{.} newline] > content-parts: copy [] > foreach part parse/all article-info end-of-paragraph [ append >content-parts part ] >] > > >;when parsing the following... > > >First paragraph here. > >Then a second paragraph. Another sentence. > >A final paragraph. > > >;creates an undesirable result, as follows... > > >make object! [ >headline: "first headline" >subheadline: "second headline" >body: ["First paragraph here" "" "" "Then a second paragraph" " >Another sentence" "" "" "A final paragraph" ""] >] > > >;For the "body" value, I would like the block to contain only >individual paragraphs. Parsing by the following value (also above)... > > >end-of-paragraph: rejoin [{.} newline] > > >;does not work as I desire (i.e. parsing ONLY by instances of a period >followed by a newline character.) Using a charset value would not work, >because then it would parse for EVERY instance of a period and a >newline, correct? How can I accomplish what I am setting out to do? >(parsing by each instance of a period followed by a newline character.) > >Thanks. > >-Ryan > >
[REBOL] parsing by period and newline
;This parsing routine... breakdown-content: func [ "breakdown an e-mail content field into its parts" msg [object!] "e-mail message" ][ article-info: msg/content end-of-paragraph: rejoin [{.} newline] content-parts: copy [] foreach part parse/all article-info end-of-paragraph [ append content-parts part ] ] ;when parsing the following... First paragraph here. Then a second paragraph. Another sentence. A final paragraph. ;creates an undesirable result, as follows... make object! [ headline: "first headline" subheadline: "second headline" body: ["First paragraph here" "" "" "Then a second paragraph" " Another sentence" "" "" "A final paragraph" ""] ] ;For the "body" value, I would like the block to contain only individual paragraphs. Parsing by the following value (also above)... end-of-paragraph: rejoin [{.} newline] ;does not work as I desire (i.e. parsing ONLY by instances of a period followed by a newline character.) Using a charset value would not work, because then it would parse for EVERY instance of a period and a newline, correct? How can I accomplish what I am setting out to do? (parsing by each instance of a period followed by a newline character.) Thanks. -Ryan
[REBOL] group projects Re:(2)
>I'm interested in reading more about your vision. OK, here goes... I have currently laid plans to develop (and have begun developing) a suite of REBOL applications I have dubbed "The News & Mail." The first in the series is an application called "The Headlines" which allows you to update the news headlines on a web site by simply sending an e-mail to a POP account. Why this functionality? For the sake of simplicity and accessibility. If you can update the news headlines on a web site by simply sending an e-mail, you can update the site from any number of e-mail clients, including those found on Palm devices, etc., so long as they are sending text/plain output (a more complicated parsing routine for RTF and HTML could be developed, as well.) The original, functioning version of "The Headlines" can be seen at http://www.fargonews.com where all of the headlines and article content appearing there has been updated via e-mail. My original script is called Scoop and can be downloaded at http://www.bebits.com/bob/3796/Scoop_1.0.zip I have completely re-written Scoop to be object-oriented, with individual news articles saved as objects which are loaded and handled later. All local settings are saved in a config file which is loaded first. The new version of Scoop is called "The Headlines" and the input portion is functional, while the text/html output needs to be broken off and developed as a separate application. The look of the text/html output is controlled by a cascading stylesheet which can be replaced by any other stylesheet using the same class names. Other ideas for "The News & Mail" suite... -"The Links" for updating web site links via e-mail. -"The Ads" for updating banner advertisements via e-mail. -Commenting System, Classified Ad System (through CGI.) -Offer access to "The Headlines," "The Links," and "The Ads" through a CGI interface, as well. Ulimately, I'm looking to offer a Web business customer the opportunity to manage a news-oriented Web site without having to actually manage a web space. The customer will be able to manage the site through e-mail and Web-based forms. Setup time for the Web developer will be minimal: perhaps 30 minutes tops to customize the config file which controls the various REBOL applications in the suite. OK, so I've spilled my guts. Input, anyone? I'd like to know what people think about saving data as objects vs. saving data in database format. I'm assuming saving the data as objects makes the data more versatile. Thanks. -Ryan
[REBOL] probe object Re:(2)
Thanks. save %article.r article saves the following in %article.r make object! [ headline: "headlineokay" subheadline: "subheadlineokay" body: ["by golly" "" "by gumby" ""] ] -Ryan >Why don't you use save? > >>> save article > >will write the object to a file. Later you can read or load it back. In >either case you will have to either do the result of reading the file, >to >convert the string (read) or block (load) to an object: > >retrieved-article: do read %article.txt >retrieved-article: do load %article.txt
[REBOL] probe object
I have a set of functions which turn the contents of an e-mail message object into a different object (called "article.") article: make object! [ headline: subject-pieces/1 subheadline: subject-pieces/2 body: content-pieces ] I'm trying to figure out how to probe the object and then write the result of the probe out to a file for inclusion at a later date. Here is a session... >> breakdown-email msg >> probe article make object! [ headline: "headlineokay" subheadline: "subheadlineokay" body: ["by golly" "" "by gumby" ""] ] >> write %bygolly.txt probe article make object! [ headline: "headlineokay" subheadline: "subheadlineokay" body: ["by golly" "" "by gumby" ""] ] REBOL - Security Check: Script requests permission to open a port for read/write on: /boot/home /bygolly.txt Yes, allow all, no, or quit? (Y/A/N/Q) Y >> uberall: read %bygolly.txt == "?object?" >> print uberall ?object? >> As you can see, the probe object only writes "?object?" to the %file. What do I need to do to write the actual contents of the object? The functions follow: ; -- BREAKDOWN-SUBJECT -- breakdown-subject: func [ "breakdown an e-mail subject field into its parts" msg [object!] "e-mail message" ][ subject-info: msg/subject subject-parts: [] foreach part parse/all subject-info ":" [ append subject-parts part ] ] ; -- BREAKDOWN-CONTENT -- breakdown-content: func [ "breakdown an e-mail content field into its parts" msg [object!] "e-mail message" ][ article-info: msg/content end-of-paragraph: rejoin [{.} newline] content-parts: [] foreach part parse/all article-info end-of-paragraph [ append content-parts part ] ] ; -- BREAKDOWN-EMAIL -- breakdown-email: func [ "breakdown an e-mail message object and convert it to an article object" msg [object!] "e-mail message" ][ subject-pieces: breakdown-subject msg content-pieces: breakdown-content msg article: make object! [ headline: subject-pieces/1 subheadline: subject-pieces/2 body: content-pieces ] ]
[REBOL] syntax highlighting Re:(4)
>Have you tried EditPlus? Yes, I use it every day. It sits on my workstation at work and whenever I get an assignment, I do it in EditPlus and then copy it over to Word later. Very nice editor. I should register it! By the way, if you could salvage that REBOL syntax file for EditPlus and make it available that would be cool.
[REBOL] cgi return of includes
Can you help me with a server-side include problem? I have a REBOL .cgi script which executes from an index.shtml file. The script checks a POP account for new mail, converts the contents of the mail strings into HTML files, then prints text/html to the browser. The text/html it prints to the browser is a list of include statements intending to include the contents of the five most recent files in a directory, as such... The index.shtml file is not "including" the articles mentioned in the include statements. They do show up fine when I view source from the resulting index.shtml page after the page has been rendered in the browser. I know "include" is working because it is including other files, albeit not from include statements generated by the .cgi script. I think the problem lies in the fact I am returning include statements to the browser, which somehow are not executed as includes. Obviously, I'm doing something wrong. Can you correct me? The script follows. Thanks. -Ryan #!rebol -cs REBOL [] reporters: [ [ "work" email.address [ [EMAIL PROTECTED] ] full.name [ "Ryan C. Christiansen" ] reporter.title [ "Editor-in-Chief" ] ][ "home" email.address [ [EMAIL PROTECTED] ] full.name [ "Ryan C. Christiansen" ] reporter.title [ "Editor-in-Chief" ] ][ "work extended" email.address [ [EMAIL PROTECTED] ] full.name [ "Ryan C. Christiansen" ] reporter.title [ "Editor-in-Chief" ] ] ] mailbox: open pop://username:[EMAIL PROTECTED] ; CHANGED FOR EXAMPLE while [not tail? mailbox] [ msg: import-email first mailbox foreach person reporters [ if info: find person 'email.address [ either find msg/from/1 info/2 [ new-article: make string! 1 append new-article {} subject-info: msg/subject subject-parts: [] foreach part parse/all subject-info ":" [ append subject-parts part ] headline: first subject-parts append new-article rejoin [{} headline {}] subheadline: second subject-parts append new-article rejoin [{} subheadline {}] temp-one: find person 'full.name byline: temp-one/2 append new-article rejoin [{} byline {}] temp-two: find person 'reporter.title title: temp-two/2 append new-article rejoin [{} title {}] article-info: msg/content end-of-paragraph: rejoin [{.} newline] replace/all article-info end-of-paragraph {.} end-of-paragraph2: rejoin [{.} crlf] replace/all article-info end-of-paragraph2 {.} append new-article rejoin [{} article-info {}] append new-article {} current-time: now/time year: to-string now/year month: to-string now/month if (length? month) < 2 [insert month "0"] day: to-string now/day if (length? day) < 2 [insert day "0"] hour: to-string current-time/hour if (length? hour) < 2 [insert hour "0"] minutes: to-string current-time/minute if (length? minutes) < 2 [insert minutes "0"] seconds: to-string current-time/second if (length? seconds) < 2 [insert seconds "0"] file-name: rejoin [year month day hour minutes seconds] complete-file-name: rejoin [file-name {.html}] write-file: reform ["write" rejoin [{%/absolute/path/ articles/} complete-file-name] "new-article"] ; CHANGED FOR EXAMPLE do write-file wait 1 ][ ignore: [] clear ignore ] ] ] remove mailbox ] close mailbox news-directory: read
[REBOL] two-digit return of now switches Re:(3)
Ah, yes, thanks for the recommendation. I am also including a wait statement in my foreach statement since I may be naming more than one file in a session. No sense naming two files within the same span of a second thus using the same name. 8-) >I'd recommend using only one "now" statement, since theoretically it's >possible that we call the first "now" at say 23:59:59.99 at 31 of December >2000. Then maybe the first statement takes some fraction of a second, so >the second "now" gets the date-time of 00:00:00 at 1 Jannuary 2001. Then it >rejoins this to.. 210100 when it should have been 20001231235959 or >2001010100 - one year wrong. Oops.
[REBOL] RealAudio REBOL Radio
I would like to begin broadcasting Real audio from my web site. My idea is to have a database of songs, DJ banter, and advertisements from which the broadcast would be generated randomly with a REBOL script. Is it possible to do this without breaking the connection between the server and the client's RealPlayer? Is there perhaps a simple client-side utility that could be written to keep the connection alive, or at least request a new file once the current one has expired? I'm looking for some ideas, perhaps from someone that has dealt with Real Audio before. Thanks. Ryan Christiansen Editor/Webmaster The BeOS Journal http://www.beosjournal.com
[REBOL] random not random Re:(2)
Exactly what I needed. You're a big help. Thanks. -Ryan >Yes, it is not random but "pseudorandom", it returns the same sequence >every time REBOL is run. Try to seed it with current time before use: > >random/seed now >ad: random 6
[REBOL] random not random
Thanks for the help so far. I have one last problem. The following script works fine now (having moved the Content-Type statement to just before the print output statement) except that it doesn't print a random banner like I expect it to. It always prints the 3rd banner, even though the pick number is set by using... ad: random 6 ...I tried giving "ad" a different value following the print statement, but it seems to have gotten caught up with the value "3" and I never see any other banner except the 3rd choice. The script should execute every time I reload the page, right? #!rebol -cs REBOL [ Title: "Banner Ad Randomizer" File: %webbanner.cgi Date: 16-Apr-2000 Author: "Ryan Christiansen" Purpose: { Generate HTML code that displays a linked banner advertisement } ] urls: [ "http://www.schonder.com" "http://www.schonder.com" "http://www.abisoft.com/BePlan/PurchaseBOSJ.html" "http://www.lebuzz.com/buzzcd_ad.html" "http://www.pushove.com/beos/" "http://www.bebits.com/app/867" ] imgs: [ "schonder.gif" "schnondersource.gif" "BePlan.gif" "buzzcd_anim.gif" "nvf.gif" "ImageProAd.gif" ] alts: [ "Papier-Schonder KG office supply and bookstore" "Papier-Schonder KG office supply and bookstore" "BePlan from AbiSoft" "BuzzCD - Hand-picked best BeOS software" "NVF: A Be-centric comic strip" "ImagePro displays, zooms, and re-sizes images" ] ad: random 6 url: pick urls ad img: pick imgs ad alt: pick alts ad print "Content-Type: text/html^/" print rejoin [{}]
[REBOL] using "print" with CGI
I re-wrote Andrew Grossman's webbanner.r (I made it simpler for my simple mind) and I am able to get rebol on my local machine to print the HTML code for a linked image on the command line but I can't get my web server to output the HTML code. Here is the script... #!rebol -cs print "Content-Type: text/html^/" REBOL [ Title: "Banner Ad Randomizer" File: %webbanner.cgi Date: 16-Apr-2000 Author: "Ryan Christiansen" Purpose: { Generate HTML code that displays a linked banner advertisement } ] urls: [ "http://www.schonder.com" "http://www.schonder.com" "http://www.abisoft.com/BePlan/PurchaseBOSJ.html" "http://www.lebuzz.com/buzzcd_ad.html" "http://www.pushove.com/beos/" "http://www.bebits.com/app/867" ] imgs: [ "schonder.gif" "schnondersource.gif" "BePlan.gif" "buzzcd_anim.gif" "nvf.gif" "ImageProAd.gif" ] alts: [ "Papier-Schonder KG office supply and bookstore" "Papier-Schonder KG office supply and bookstore" "BePlan from AbiSoft" "BuzzCD - Hand-picked best BeOS software" "NVF: A Be-centric comic strip" "ImagePro displays, zooms, and re-sizes images" ] ad: random 6 url: pick urls ad img: pick imgs ad alt: pick alts ad bannerHTML: rejoin [{}] print bannerHTML *** I have also tried the following... bannerHTML: print rejoin [{}] do bannerHTML ... but the browser outputs "do bannerHTML"
[REBOL] webbanner.r help Re:(2)
OK, so in the following function... make-banner: func [/ad adnumber /local url img alt] [ set [url img alt] skip banner-db either ad [ adnumber - 1 * 6 ][ random (length? banner-db) / 6 ] rejoin [{}] ] ...how does adnumber get its value and what is the purpose of the adnumber word? >you now have 18 entries in the >database, six records of length 3 each, and not 36 entries. But when you >call make-banner with the ad refinement, get >adnumber - 1 * 6 > >is 6 - 1 * 6 = 30. No wonder you get none.
[REBOL] webbanner.r help
I downloaded Andrew Grossman's webbanner.r from the rebol.com script library and I'm having some difficulty. The script is executed using an
[REBOL] Books and such Re:
The REBOL Official Guide with CD-ROM will be available May 22. This is pushed back from the original release date of sometime this past February. I'm waiting, too, but I'm looking forward to it. In the meantime, download the REBOL dictionary and user's guide in .pdf format from The BeOS Journal at http://www.beosjournal.com/rebol/ rebolpdf.zip Enjoy. -Ryan >Are there any books or other printed material for Rebol? >Something that can help someone with minimal programming experience?
[REBOL] Removing lines... Re:
REBOL [] secure none out: make string! 10 words: copy [] foreach fields next read/lines %blaah.txt [ checker: true clear words foreach word parse fields newline [append words word] firstword: pick words 1 if firstword = "pluup" [ clear fields checker: false checker ] either checker = false [ clear fields ][ append out fields ] ] write %newblah.txt out >Hi list, >I've read a textfile with read/linesis there an easy way to remove a >line from the data? > >it goes something like: > >data: read/lines %blaah.txt > >if find data "plupp" [remove the line] <--- of course there oughta be some >easy code there.. ;) > >Best Regards >Stefan Falk > >
[REBOL] B2 Status Re:
What is REBOL/View? Is it a text editor built especially for REBOL? >Just wanted to give you a quick update on REBOL/View Beta 2 status: > >We're still cranking away, but getting much closer now.
[REBOL] finding the correct binary
How can I find out which rebol binary to upload to my cgi-bin directory? I am using Dellhost, which has several possible server configurations. I do not have telnet access to my site, but I do have ftp. When I use the 'system' command in ftp it tells me >ftp system 215 UNIX Type: L8 Isn't there a web page somewhere where I can submit my URL to find out my server configuration? Thanks. -Ryan
[REBOL] cgi
My browser displays the following error... Script execution error Unable to execute script due to a configuration problem. Please notify the webmaster of this error. exec() returned: 2: No such file or directory When I send a form using this HTML code... to a script with the following header... #!/custs/home/b/beo12981/rebol --cgi for which permissions are set as follows... -rwxr-xr-x 1 beo12981 www594 Mar 22 21:55 cgidump.cgi -rwxr-xr-x 1 beo12981 www 292855 Mar 3 23:08 rebol -rwxr-xr-x 1 beo12981 www 3851 Mar 3 23:08 rebol.r What could be wrong? When I had the script set with a .r extension, the server would spit back out the script itself as a text file. When I changed the script to have a .cgi extension, I received the error above. -Ryan
[REBOL] CGI ques.
My REBOL cgi doesn't work I have the following statement in an html form... the html form is in the same directory as the /cgi-bin folder. Here is the contents of cgiemailer.r in the cgi-bin directory... #!rebol -cs REBOL [] print "Content-Type: text/plain^/" ;-- Required Page Header set-net [[EMAIL PROTECTED] pop.mail.domain.net] send [EMAIL PROTECTED] decode-cgi system/options/cgi/query-string print "Email sent." - Here are the permissions as seen in the cgi-bin directory... 230-Sun Microsystems Inc. SunOS 5.7 Generic October 1998 Remote system type is UNIX. -rwxr-xr-x 1 user www584 Mar 17 21:21 cgiemailer.r -rw-r--r-- 1 user www 20691 Mar 3 23:08 nntp.r -rwxr-xr-x 1 user www 292855 Mar 3 23:08 rebol -rw-r--r-- 1 user www 3851 Mar 3 23:08 rebol.r The problem I am having is when I fill out the form (I leave no blank fields) the browser returns the cgiemailer.r script as text in the browser. Do I need to tell the server to recognize .r files somehow? I don't know how to do it exactly, but it must be something similar to setting up the server to recognize .html files for server side includes, as follows... Options Indexes FollowSymLinks Includes AddType application/x-httpd-cgi .cgi AddType text/x-server-parsed-html .html Thanks in advance. -Ryan
[REBOL] newnews Re:(2)
I tried it through telnet on my local ISP news server and yup, you're right. Ah, well. -Ryan >200 cronkite.sunshinecable.com InterNetNews server INN 2.3experimental 14-Dec-1999 >ready >newnews alt.binaries.mp3 000309 00 >502 NEWNEWS command disabled by administrator
[REBOL] getting rebol "OK"
I am searching for a new web hosting service and I figure it is a good business practice to ask the hosting service if it is "OK" to use scripting languages other than perl for CGI. The response is usually, "what scripting languages are you thinking about?" When I tell them REBOL and point them to the REBOL web page, they tell me (all of them so far) that REBOL is not a language that can be used on their servers. What does a person do besides installing and using the binary first and asking for forgiveness later? -Ryan
[REBOL] nntp limited by date
I would like to use the nntp.r protocol to retrieve messages from a newsgroup limited by date. Is there any way to do this with nntp.r? -Ryan
[REBOL] pick server-said 4
when trying to use ftp with the following script REBOL [] secure none set-net [[EMAIL PROTECTED] pop.mail.network.net] site: ftp://user:[EMAIL PROTECTED]/public_html files: [%NEWSbeadvocacy.html %NEWSbehelp.html %NEWSbemisc.html %NEWSbeprogrammers.html] foreach file files [ write site/:file read file ] I received the error ** Script Error: pick expected series argument of type: series money date time object port tuple any-function. ** Where: pick server-said 4 Where does the "pick server-said 4" come in when it is a script error? -Ryan
[REBOL] if this or that, then action Re:(2)
>>> firstword: "Paths" >>> if find swords firstword [print "Action block if found"] >== false >>> firstword: "Path" >>> if find swords firstword [print "Action block if found"] >Action block if found >>> Yes, this is exactly what I was looking for. I tried using the pipe | like in the parse dialect, but it didn't work (obviously) and "or" doesn't work for strings (or so console told me.) Thanks for the input. I'm a newbie to programming (my only experience is programming in AppleSoft BASIC 15 years ago) and I really appreciate the help. In case you didn't recognize it in the code, I am working on a script that grabs the headers and bodies for a newsgroup from a news server, then discards all of the unwanted headers and builds the page nicely with HTML tags. Then I will have it FTP the information to a site somewhere. I would like to make this automated at some point, where the script runs every 15 mins. or so and refreshes the information, but I have a ways to go with that. -Ryan
[REBOL] out of range or past end Re:(2)
I just finished reading your e-mail and I appreciate all of your help. I am still learning REBOL (obviously) and help like this is much appreciated. I always like to know better ways to do things. That is how you learn. Thanks. -Ryan >A simpler version of your code would look like this: > >out: make string! 10 >insert out {} >words: make block! 0 > >foreach fields next read/lines %messages.txt [ > clear words > foreach word parse fields ":" [append words word] > firstword: pick words 1 >]
[REBOL] newsgroups Re:(2)
Yup. Thanks. -Ryan >Hi, > >If your are using news:// protocol/dialect (described in the how-to >http://www.rebol.com/howto.html#news.html) rather the built in nntp:/ / >protocol (described in the manual http://www.rebol.com/users/ netnntp.html) >You need to do the %nntp.r file.. >do %nntp.r > >Cheers, > >Allen K
[REBOL] newsgroups
WITH THE FOLLOWING SCRIPT... REBOL [] secure none print "security level set to none" nntp-host: news://news.uswest.net np: open nntp-host print "news host opened" write/append %BeAdvocacyMessages.txt insert np [headers-bodies from "comp.sys.be.advocacy"] print "messages retrieved" I GET THE FOLLOWING ERROR... ** Access Error: Invalid port spec: news://news.uswest.net. ** Where: np: open nntp-host print "news host opened" WHAT AM I DOING WRONG? THANKS.
[REBOL] syntax coloring rules
Has anyone developed any syntax coloring rules for REBOL? I want to get a REBOL syntax coloring add-on developed for Pe, the Programmers' Editor, for BeOS. Although I can't do the .cpp myself, I know someone who will do it for me if I can come up with syntax coloring rules. -Ryan
[REBOL] pdf again Re:(2)
I just made .pdfs for myself and thought I would share. I don't know how to combine .pdfs, really. I used Acrobat at work on a machine I have limited access to. Sorry I couldn't help you more. -Ryan >Can you wrap this into one .pdf ragher than dozens? >Len >===>>due to bandwidth restrictions, I have moved the rebol user guide and >>dictionary to an unlimited bandwidth site at >> >>http://www.beosjournal.com/rebol/rebolpdf.zip > >
[REBOL] pdf again
due to bandwidth restrictions, I have moved the rebol user guide and dictionary to an unlimited bandwidth site at http://www.beosjournal.com/rebol/rebolpdf.zip
[REBOL] user guide/dictio in pdf
I have posted a copy of the latest user's guide and dictionary in .pdf format in a .zip file at http://www.fargonews.com/rebol/rebolpdf.zip Even zipped up, it is a rather large file (1.2 MB.) -Ryan
[REBOL] network timeout Re:(2)
That simple modification to my script made all of the difference. Thanks for the help. -Ryan >The key is to make sure that the try block is is only evaluating the read url >action and not find read. >The more you can narrow what an error try block is testing, the better you can >respond/identify to any errors.
[REBOL] network timeout
How can I avoid getting the following error in REBOL? Access Error: Network timeout. Below is the meat of the script I am running. I have already used an error? statement to try to eliminate this problem. The script first verfies it can connect to a server before trying to read the index page on the server. Is there anything more I can do to prevent the script from stopping on an access error? My real script has about 500 urls in the site: block and it is a real pain when the script stops running because of an access error. Thanks. -Ryan ;--- webfinder.r variation --- REBOL [ Title: "Search Multiple Web Pages" File: %webfinder.r Date: 20-May-1999 Purpose: { Search multiple web pages for a string, and print the URL of the ones where it was found. } ] secure none sites: [ http://www.news.com/ http://www.herring.com/ http://www.slashdot.org/ ] foreach url sites [ either error? try [find read url "REBOL"] [next url] [either find read url "REBOL" [print "FOUND mention of REBOL"] [print "no mention of REBOL"]] ]
[REBOL] parse by newline
I want to parse with the newline character denoting when to begin a new series element. I've tried using /all with specific stop characters, but I can't figure out how to add in just the newline character for the parse. -Ryan
[REBOL] func answer
After playing around, I think here is a terminal session that shows how to "make sure" the arguments are used locally. >> use [ src text.align alt ] [ display|image: make function! [ src text.align alt ] [[ rejoin [ {} ] ] ] >> display|image http://www.fargonews.com/mac.jpg "center" "Internet Startup Kit" == {http://www.fargonews.com/mac.jpg" Align=center ALT= "Internet Startup Kit">} >> src: 1 == 1 >> text.align: 2 == 2 >> alt: 3 == 3 >> display|image http://www.fargonews.com/mac.jpg "center" "Internet Startup Kit" == {http://www.fargonews.com/mac.jpg" Align=center ALT= "Internet Startup Kit">} >> print src 1 >> print text.align 2 >> print alt 3 >>
[REBOL] func question
I created the following function for joining the information necessary to display a web page image in HTML. display|image: make function! [ src text.align alt ] [ rejoin {} ] My question is, if I choose to use the words in block [ src text.align alt ] in any other function or anywhere else in the script, could there be a conflict in values? Or do the values in a function remain entirely within the function? Thanks. Ryan Christiansen
[REBOL] ftp problem
For some reason I am not able to upload a file to my web server. Can you tell me what I am doing wrong? *** HERE IS THE SCRIPT *** (note: my real script has the actual username and password in it) site: ftp://user:[EMAIL PROTECTED]/ local: %/boot/home/webdata/images/ foreach file read/binary %/boot/home/webdata/images/ [ print ["Uploading:" site/:file] write/binary site/:file read/binary local/:file ] *** HERE IS WHAT I SEE IN MY TERMINAL WINDOW *** (note: the real terminal response has the actual username and password in it) Uploading: ftp://user:[EMAIL PROTECTED]/adpromo1.jpg connecting to: news.com ** Script Error: pick expected series argument of type: series money date time object port tuple any-function. ** Where: pick server-said 4
[REBOL] again: reading contents of each file in dir
I need a little more help. I'm trying to read the contents of every file in a directory and use the contents of each file in a foreach statement. What do I need to do to harness the contents of the files instead of the file names themselves? It is not useful for me to list every file individually (i.e. as a block [ %file.txt %file2.txt ] ) ;--first try news_dir: %/boot/home/webdata/news/ foreach file read %news_dir [ print news_dir/:file ] ** Access Error: Cannot open /boot/home/Desktop/news_dir. ** Where: foreach file read %news_dir [print news_dir/:file] ;--second try news_dir: %/boot/home/webdata/news/ foreach file read %news_dir [ print %news_dir/:file ] ** Syntax Error: Invalid file -- %news_dir/:file. ** Where: (line 260) foreach file read %news_dir [ print %news_dir/ :file ] ;--third try news_dir: %/boot/home/webdata/news/ foreach file read news_dir [ print news_dir/:file ] /boot/home/webdata/news/18950604-CASSELTON (right now there is only one file in the directory, but as you can see my script is only printing the NAME of the file and its path, not its contents.) What am I doing wrong? Thanks. Ryan Christiansen