View script | License | Download documentation as: HTML or editable |
Download script | History | Other scripts by: sunanda |
[0.057] 82.56k
Documentation for: lds-local.rVersion: 0.0.8 31-Jan-2006 Sunanda 1. History1.1. 2-Mar-2006 -- 0.0.8
1.2. 28-Jan-2006 -- 0.0.7
1.3. 9-Feb-2005 -- 0.0.6
1.4. 8-Sep-2004 -- 0.0.5
1.5. 9-Jul-2004 -- 0.0.4
1.6. 28-Apr-2004 -- 0.0.3Archive version requests added:
1.7. 19-Jan-2004 -- 0.0.1Initial version1.8. 20-Feb-2004 -- 0.0.2Package handling requests added:
2. OverviewLibrary Data Services (LDS) is an interface to the REBOL.org website that lets any REBOL program retrieve data from the Library in a REBOL format. Example: get the list of Library membersprobe lds/send-server 'get-user-list [] make object! [ status: [0 0 "] data: make object! [ user-list: ["gregg" "volker" "sunanda"] ] ]What comes back is a REBOL object with just two fields:
3. UsesYou could use this interface to:
4. Levels of accessLDS defines three levels of access:
4.1. PublicBroadly, any data you can retrieve via a web browser while not logged on:
4.2. MemberThings you can do as a member of the Library:
4.3. OwnerThings you can do as the owner of a script:
5. Installing Library Data ServicesRun it directly from the REBOL.org server: do http://www.rebol.org/library/public/lds-local.r That's all it takes. 6. Using Library Data Services6.1. Initialising the interfaceIssue this call once before you call the service: do http://www.rebol.org/library/public/lds-local.r 6.2. Calling the interfaceAll calls have the same format:response-data: lds/send-server 'request [parameters]
6.3. Calling the interface with a tokenA Library token is needed if you are doing something at the Member or Owner level. Getting a token is explained later (see Library Tokens). A call using a token looks like this: response-data: lds/send-server/use-token 'request [parameters] 7. Status replyLDS always replies with values in the Status field. It is a block with three parts:
7.1. Status/1An integer! between 000 - 999. The values are divided into specific ranges:
7.2. Status/2May contain context-sensitive information. For example, if the status/3 text is "script not found" , status/2 may contain the script name we were looking for. Not all requests support this.7.3. Status/3A short text, in english, describing the problem.7.4. Examplesprobe lds/send-server 'list-updated-scripts ["zzzzz"] make object! [ status: [200 0 "non-integer days"] data: none ](zzzzz should be an integer) probe lds/send-server 'get-script ["xxxx.r"] make object! [ status: [300 0 "unknown script"] data: none ](xxxx.r is not a script in the Library) probe lds/send-server 'get-script ["sssss.r"] make object! [ status: [400 0 "can't connect"] data: none ](You may be offline) 8. Library tokensTo use some LDS requests, you must be a member of the Library. If you are not a member of the Library, you can join by going here: http://www.rebol.org/cgi-bin/cgiwrap/rebol/signup.r LDS needs you to supply a Library token on each call. This identifies who you are in much the same way that a cookie does when you visit the Library using the web interface. 8.1. Getting a tokenLog on, and visit this page: http://www.rebol.org/cgi-bin/cgiwrap/rebol/lds-library-tokens.r Tell it how many tokens you want (one is normally enough -- see multiple tokens below for why you may want more than one) and click "send me tokens" . The tokens will be emailed to your registered address. 8.2. Install the tokenA token looks something like this: #{00C04C0913E76ECFF780DD73} Save it as a text file called lds-library-token.txt in the folder from which you execute Library Data services, eg: write %lds-library-token.txt mold #{00C04C0913E76ECFF780DD73} The token is now ready for use. 8.3. Using the tokenAdd the /use-token refinement to each lds/send-server request, eg: Response-object: lds/send-server/user-token 'token-test ["test my token"]
8.4. Multiple tokensIf you use LDS from more than one location (perhaps on different machines) you need a different token for each location. You can have as many tokens as you want. 9. General Library requests9.1. helpReturns a list of all LDS requests and some help on each of them -- a good way to see if you have an out-of-date copy of these notes.
9.1.1. Exampleprobe lds/send-server 'help none make object! [ status: [0 0 "] data: make object! [ request-list: [ "get-rml-message" make object! [ authorisation?: false purpose: {Retrieve a message from the REBOL Mailing list archive} parameters: "Msgid [integer!]" response: "Object containing message and control headers" ] "get-script" make object! [ [snip] 9.2. list-usersRetrieve list of activated Library members
("activated" means they have logged on at least once) 9.2.1. Exampleprobe lds/send-server 'list-users [] make object! [ status: [0 0 "] data: make object! [ user-list: ["volker" "gregg" "sunanda"] ] ] 10. Mailing List requestsUse these requests to read messages from the Mailing list archive 10.1. get-rml-messageRetrieve a message from the REBOL Mailing list archive
10.1.1. Example 1 -- get a single messageprobe res: lds/send-server 'get-rml-message [237859]The fields in the data object for this request are:
10.1.2. Example 2 -- get all messages for a given threadmsgs: copy [] res: lds/send-server 'get-rml-message [213498] forever [ append msgs res/data if res/data/links/3 = 0 [break] ;; no next-in-thread link res: lds/send-server 'get-rml-message reduce [res/data/links/3] ] print ["There were" length? msgs "message(s) in the thread"] 10.1.3. Example 3 -- get the latest messagemsgs: copy [] res: lds/send-server 'get-rml-message ["latest"] 10.2. get-rml-statusSends you back some status information about the Mailing list archive.
10.2.1. Exampleprobe res: lds/send-server 'get-rml-status [] make object! [ status: [0 0 "] data: make object! [ counts: [241337 241337] threads: [8706] years: [1980 2000 2001 2002 2003 2004 2005 2024] ]The fields in the data object for this request are:
get-rml-status is most useful for getting the full span of years for a search-rml request....See immediately below. 10.3. search-rmlSends you back the message ids for all threads that meet your search criteria
10.3.1. ParameterThe parameter is a single quoted string. It should contain at least one word on which you want to search. It may also contain one or more years.
10.3.2. Examples of the search parameter:
10.3.3. Response objectContains both the message ids of the messages that matched your search, and some reflected back fields to confirm what has been searched. An example is make object! [ status: [0 0 "] data: make object! [ target-words: ["apple" "pink" "white"] search-type: "posts" span: [2003 2002 2001 2000] msgids: [207276] ] ]
10.3.4. Searchable yearsUsing the search-rml request, you can search on all years for which threads exist. This includes some strange ones, such as 1980 and 2024. They exist because we take the date field in the original email's header as correct. and, obviously, in some cases they were not: the sender's ISP or server was badly set up. We don't have much choice about that. The Mailing list archive started some years after the Mailing list, so we don't have accurate context information to correct the problem. 10.4. Examplesprobe lds/send-server 'search-rml ["async version"] make object! [ status: [0 0 "] data: make object! [ target-words: ["async" "version"] search-type: "subjects" msgids: [234122] ] ] probe lds/send-server 'search-rml ["1960 1961 help me to get a good job 2004 2003"] make object! [ status: [0 0 "] data: make object! [ target-words: ["get" "good" "help" "job" "me"] search-type: "posts" span: [2004 2003] msgids: [230329 230451 ....snipped .....] ] ] Note that the span contains only the years we could search (we don't have messages from the 1960s), and the target-words does not include the stop words "to" and "a". 11. Script requestsUse these requests to search the Script Library, and to download scripts. 11.1. get-scriptRetrieve latest version of a script
Returns the source of the named script 11.1.1. Example:probe lds/send-server 'get-script ["wumpus.r"] make object! [ status: [0 0 "] data: make object! [ script: {REBOL[ Title: "Hunt the Wumpus" Date: 20-Jul-2003 File:^- %wumpus.r Purpose: "A REBOL version of a retro text game. Just for fun." Author: "Gregg Irwin" EMail: greggirwin@acm.org Version: 1.0.1 Library: [ level: 'intermediate platform: 'all [snip] 11.1.2. Note to script ownersIf you own a script, and check its download count on the statistics page of REBOL.org: LDS get-script downloads are counted as "Total LDS downloads" . 11.2. list-scripts-by-filterReturns a list of script names that match the search filter.
11.2.1. Exampleprobe lds/send-server 'list-scripts-by-filter [domain-xml] make object! [ status: [0 0 "] data: make object! [ script-list: ["json.r" "xmlgen.r" "rblxelparser.r"] ] ] 11.3. list-search-filtersReturns an object with all the possible filters that can be used with list-scripts-by-filter
The response object has a series of blocks, each represents a possible set of filters, for example type: [article demo dialect faq function ... ] means you can filter on type-article type-demo etc 11.4. search-scriptsReturns a list of script names that contain the words you asked for
11.4.1. Exampleprobe lds/send-server 'search-scripts ["decompress"] make object! [ status: [0 0 "] data: make object! [ script-list: ["compress.r" "autoextract.r"] ] ] The script-list returned is in script relevance order: best matches first. 11.5. list-scripts-owned-byReturns a list of scripts owned by a given Library member
If the owner name is not recognised, the script-list is returned as an empty block. 11.5.1. Example -- get list of scripts owned by Sunandaprobe lds/send-server 'list-scripts-owned-by ["sunanda"] make object! [ status: [0 0 "] data: make object! [ script-list: ["cookie-example.r" "oneliner-chess-board.r" "oneliner-monty-hall.r"] 11.6. list-updated-scriptsGet a list of new or updated scripts in the last [n] days
Lets you find which scripts have been added or updated in the last n days. n is an integer: 1 or more 11.6.1. Example 1: what's new in the last 15 days?probe lds/send-server 'list-updated-scripts [15] make object! [ status: [0 0 "] data: make object! [ script-list: ["mtv.r" "mvt.r" "mvs.r"] ] ] 11.6.2. Example 2: Download new versions of scripts changed in the last 31 daysres1: lds/send-server 'list-updated-scripts [31] foreach scr res1/data/script-list [ res2: lds/send-server 'get-script reduce [scr] write to-file scr res2/data/script ] 12. Script Archive requestsUse these requests to get archived versions of scripts (each time a script owner updates a script, we put the previous version in the archive. In some cases, the previous versions remain available for download). 12.1. list-archive-versionsREBOL.org usually only shows the latest version of each script. Previous versions may still be available. This request returns a list of all publicly available versions of a script.
12.1.1. Example:probe lds/send-server 'list-archive-versions [demo1.r] make object! [ status: [0 0 "] data: make object! [ archive-versions: [ [7 15-Mar-2004 "Fixed bug in header"] [12 28-Apr-2004 "Version 2.0 -- supports IOS"] ] ] ] In the above example, there are two publicly-available versions of the script: 7 and 12. The version number is an internal number to the Library. It will usually be different to the owners' version number in the script itself. The highest version number show will always be the current live version of the script. Lower numbered entries are back-versions of the script that the owner has left publicly available. To retrieve an archive version of a script use the request get-archive-version. 12.2. get-archive-versionRetrieve an archived version of a script (see list-archive-versions for more details)
12.2.1. Examples:Get archive version 17 for script demo1.r: probe res: lds/send-server 'get-archive-version ["demo1.r/17"] make object! [ status: [0 0 "] data: make object! [ script: #{ 789CC551C14AC34010BDEF574C03524592565191F46015EB410445C54BE86193 snip ED800F8DA6768B8BCD39E0D9FE255DA877CE25EAB52D030000 } ] ] demo1.r has a publicly available version 17, so it has been returned: Get archive version 14 for script demo1.r: probe res: lds/send-server 'get-archive-version ["demo1.r/14"] make object! [ status: [301 "demo1.r" "not available"] data: none diagnostics: [41641 33710 0.11] ] Version 14 of demo1.r is nor publicly available. If you need that exact version, contact the owner and ask them to make it available. 13. Update scripts requests13.1. contribute-scriptUse this request to either add a new script to the Library; or update an existing script that you own.
13.1.1. ParametersAre a dialect with these words: mode, note, and script. Mode and script must always be present. Note is optional.
13.1.2. Example of the dialect:note "changed error handling" mode check script {rebol [file: %zzz.r .....} 13.1.3. Examples of usescr: {rebol [] quit} response-object: lds/send-server/use-token 'contribute-script compose [mode "check" note "fix error handling" script (scr)] This example does not send an acceptable script! This is what you'd get back: Probe response-object make object! [ status: [210 30 "problems with script"] data: make object! [ validation: ["file" "We need a File: field in the REBOL header." "title" "We need a Title: field in the REBOL header." "date" {The Date: field in the REBOL header needs to be a valid REBOL date. (Not none)} "purpose" "We need a Purpose: string in the REBOL header."] ] ] 13.2. get-script-documentationRetrieve the documentation for a script, either as HTML or in its editable format
13.2.1. Examples:probe res: lds/send-server 'get-script-documentation ["lds- local.r/editable"] make object! [ status: [0 0 "] data: make object! [ documentation: #{ 789CED7D6977DBD6D9E077FF8A1BF6742C69448AE04E2675476BDF74ECC68D9D E4EDE8B8E7402428210601160045AB99FCF77996BB622129937E9BCE8CCE492C 91C05D9EFBECDBFDC617B1BF08FED0C89369D36BBCFAE6CC7FF5CD43E7D5EBF0 2EF5D32771E5E7BE7817A48FE134C8BE39836F04FD7C330B1FC534F2B38C5E85 [snip] print decompress res/data/documentation [h2 Library Data Services [contents [asis Version: 0.0.5 12-Sep-2004 Sunanda [snip] 13.2.2. Note to script ownersIf you own a script, and check its download count on the statistics page of REBOL.org: LDS get-script downloads are counted as "Total LDS downloads" . 14. Script owner requestsUse these requests to get information about a script that is only available to the script owner. 14.1. List-my-scriptsReturns the list of scripts that you own. Similar to list-scripts-owned-by, but you identify yourself by using a Library token.
14.1.1. Exampleresponse-object: lds/send-server/use-token 'list-my-scripts [] 14.2. get-script-statsReturns owner statistics for the script -- only available if you own the script.
14.2.1. Exampleresponse-object: lds/send-server/use-token 'get-script-stats [lds-local.r] 15. Package read requestsUse these requests to query or retrieve files from packages. There is a also special LDS utility that makes working with packages easy: do http://www.rebol.org/library/public/repack.r 15.1. get-package-headerRetrieve the header for a package -- i.e. the index to that package.
15.1.1. data/package-file-list fields
15.1.2. Possible errors.The package may not exist, or may not be available. See http://www.rebol.org/cgi-bin/cgiwrap/rebol/boiler.r?display=lds-package-dow nloader-help.html for a list of the package error messages 15.1.3. Example -- header for package lds-demo1-package.rprobe res: lds/send-server 'get-package-header ["lds-demo1-package.r"] make object! [ status: [0 0 "] data: make object! [ user-notes: {Run lds-demo1.r under REBOL/View and see if you can Spot The Developer!} package-file-list: [ make object! [ file-name: "image1.jpg" cgi-type: "image/pjpeg" install-folder: "images/" file-type: "file" version: 0.0.4 last-updated: 17-Apr-2004/16:17:19.39+1:00 notes: " checksum: #{4001620992AE7B6974F159A6D957571CD1558E36} file-size: 17165 compressed-size: 12573 ] make object! [ file-name: "image2.jpg" cgi-type: "image/pjpeg" install-folder: "images/" file-type: "file" version: 0.1.0 notes: " checksum: #{B76028C7C1D1DFFF2584788BEC82B8F7A8B55C07} file-size: 75276 compressed-size: 39052 ] etc -- one entry per file 15.1.4. file-type:packageThis means that the file is itself another package. That probably means that his package requires all the files from that package to be downloaded for a complete installation. The package header for the current package does not include all the files for the included package. If you are writing a package installer or downloader you may need to take into account file-type:package. If you do, issues include:
15.2. get-package-fileRetrieve one file from a package
15.2.1. Example -- file notes.txt package lds-demo1-package.rprobe res probe res: lds/send-server 'get-package-file ["lds-demo1-package.r/notes.txt"] make object! [ status: [0 0 "] data: make object! [ file: #{ 789C7552D16ED3500C7D8F947F70DF3AD4A06D8C017B63A39B040C101DF0EC24 6E7AD5C48E1CA7617F8FEF6DD6371429B24F7C8E8FEDE4599EDDB5A1DA83096C 0CD5F26C89AD15D50B3898F46779F6BF67D38B81ED087EAE6FBF7F859A0ED44A snip 074DF93BCF8F8B9881F70EA41B9DFEB6237F9567171F8A7B2A8BCBF3F3AB3CFB 07C289D8E6C6020000 } ] ] 15.2.2. NotesThe file as returned is compressed: decompress res/data/file {^M ^M Click to Start^M (alt-click to stop)^M ^M ^M ^M ^M Spot the REBOL developer!^M To save it, and lose all those ^M thingies in a text file, always save the file as binary: write/binary %notes.txt decompress res/data/file print read %notes.txt Click to Start (alt-click to stop) Saving the file as binary is always the correct thing to do: the file may be a JPG or executable, or some other non-text format. 16. Package update requests16.1. Overview before we startA package is a multi-file unit that makes up one contribution to the Library. From a user's perspective, it is three things:
All the LDS requests for uploading or updating packages will need a Library token. Again, as with the contribute-script request, there is a mode parameter on every request.
16.2. Transaction level supportTo create a full and usable package, several requests (perhaps many) have to be issued and succeed. If the server or the client fail part-way through, there will be an incomplete or unusable package left on public view. This is not so different from when a user is uploading files by hand to create a package -- their connection could fail at any point. I just mention in it case LDS clients want to get clever with some restart code. LDS itself will not be offering any sort of journaling or rollback. It sees and actions individual requests. 16.2.1. Step 1: contribute-scriptUse contribute-script request to upload a new script. Include 'package in the Library header 'type field. After successfully contributing a new script, various automated mechanisms start telling the world the good news (email notices, RSS feed, "what's new" pages, etc) So some quick off-the-mark people may be looking at the new package before we've uploaded all the files. Nothing much we can do about that. It's part of the way packages were implemented as a bolt-on. 16.2.2. Step 2: update-package-headerUse this request to:
16.2.3. Step 3: upload-package-fileUse this request for each of your files that are part of the package. 16.2.4. Step 4: include-script-in-packageUse this request for any existing Library scripts that are part of the package. 16.2.5. Step 5: update-package-header againUse this again to set the package as available . People can now download your new package. 16.3. Steps involved in updating a packageIf you later need to change the package, use these steps: 16.3.1. Step 1: update-package-headerSet the package as unavailable to prevent people accidentally downloading an incomplete or inconsistent package 16.3.2. Step 2: upload-package-fileTo add new files or update existing ones 16.3.3. Step 3: remove-file-from-packageTo remove a file from the package 16.3.4. Step 4 include-script-in-packageTo include additional Library scripts in the package 16.3.5. Step 5 remove-script-from-packageTo remove a Library script from the package. 16.3.6. Step 6: update-package-headerUse this again to set the package as available . People can now download your updated package. 16.4. update-package-headerUse this request to add or update the header details of a package
16.4.1. ParametersAre a dialect with four words : mode, script-name and status and user-notes
16.4.2. ResponseA data object that normalises the dialect -- if you had any fields missing or with unacceptable values, you can see from the response what we assumed. 16.4.3. ExamplesA full request looks something like: lds/send-server/use-token 'update-package-header [script-name "example-package.r" mode "update" status "private" user-notes "Only works on MACs" ] (As with all these requests, the order of the keywords in the dialect does not matter) These following examples stand in for a lot of detailed exposition about error checking and what we do with bad requests. The data section of the response is the internal, normalised dialect words -- so you can see how LDS-server has interpreted missing or bad data: probe lds/send-server/use-token 'update-package-header [ script-name "example-package.r" mode "update" ] make object! [ status: [300 0 "unknown script"] data: make object! [ script-name: "example-package.r" mode: "update" status: none user-notes: none ] ] Problem: no such script. Expect similar errors for:
probe lds/send-server/use-token 'update-package-header [ script-name "example-package.r" user-notes "zzz" ] make object! [ status: [0 0 "] data: make object! [ script-name: "example-package.r" mode: "check" status: none user-notes: "zzz" ] ] Appears to have worked (got a 0 response), but the missing mode was taken as check -- so no changes made. lds/send-server/use-token 'update-package-header [ script-name "example-package.r" mode "do it" user-notes "zzz" ] make object! [ status: [0 0 "] data: make object! [ script-name: "example-package.r" mode: "check" status: none user-notes: "zzz" ] ] Mode is bad (not check or update ) -- treated as its safest value, check . Again, no update. probe lds/send-server/use-token 'update-package-header [ script-name "example-package.r" mode "update" user-notes "zzz" ] make object! [ status: [0 0 "] data: make object! [ script-name: "example-package.r" mode: "update" status: none user-notes: "zzz" ] ] This one worked. It updated the user notes, but did not change the status (because none was specified). lds/send-server/use-token 'update-package-header [ script-name "example-package.r" mode "update" status "confused" ] make object! [ status: [0 0 "] data: make object! [ script-name: "example-package.r" mode: "update" status: "private" user-notes: none ] ] This one worked, but may not have done what you expected. There was a status, but it was a bad value (neither private or public ) we normalised it to private that being the safest value. The user notes remain unchanged. probe lds/send-server/use-token 'update-package-header [ script-name "example-package.r" mode "update" status "public" user-notes " ] make object! [ status: [0 0 "] data: make object! [ script-name: "example-package.r" mode: "update" status: "public" user-notes: "linux only" ] ] Changes the status to public and sets the user notes to " 16.5. upload-package-fileUse this to add or update details of a file in the package
16.5.1. ParametersAre a dialect with these words: mode, script-name, file-name, install-folder, user-notes, version, contents, and checksum. Mode, script-name and file-name must always be present
16.5.2. Examplesprobe lds/send-server/use-token 'upload-package-file [script-name "example-package.r" mode "update" file-name "image-1.jpg" install-folder "images/" user-notes "Photo of Fluffy Bunny" version "0.0.5" contents #{...binary field...} checksum #checksum/secure of contents (to detect in-flight damage) ] Uploads a new file (or completely replaces the details of an existing one) lds/send-server/use-token 'upload-package-file [script-name "example-package.r" mode "update" file-name "image-1.jpg" install-folder "my/images/" user-notes "Better Photo of Fluffy Bunny" version "1.0.5" ] Will change the install-folder, user-notes and version lds/send-server/use-token 'upload-package-file [script-name "example-package.r" file-name "image-1.jpg" mode "update" user-notes "Even better Photo of Fluffy Bunny" ] Will change just the user notes. 16.5.3. What you get backUpload-package-file returns the normalised dialect, but the contents field is set to [omitted] -- no point sending back a 5meg file, or however large the file is. 16.6. include-script-in-packageUse this to include an existing Library script in the package. Note that you don't upload the script (after all, we already have it). You just tell us to make it part of the package.
16.6.1. ParametersAre a dialect with these words: mode, script-name, file-name, install-folder, library-script-name.
16.6.2. Examplelds/send-server/use-token 'include-script-in-package [script-name "example-package.r" mode "update" library-script-name: "convert-base.r" install-folder "lib-scripts/" ] 16.7. Remove-file-from-packageUse this to remove a file you have uploaded to a package.
16.7.1. ParametersAre a dialect with these words: mode, script-name, file-name, and install-folder.
16.7.2. Examplelds/send-server/use-token 'remove-file-from-package [script-name "example-package.r" mode "update" install-folder: " file-name "image-1.jpg" ] image-1.jpg will not be a part of the package after this request is run. (Note: this does not mean it was a part of the package before; but, if it was, it isn't now) 16.8. Remove-script-from-packageUse this to remove a Library script from the package.
16.8.1. ParametersAre a dialect with these words: mode, script-name, file-name, install-folder, library-script-name.
16.8.2. Examplelds/send-server/use-token 'remove-script-from-package [script-name "example-package.r" mode "update" install-folder: " Library-script-name "convert-base.r" ] /convert-base.r will not be a part of the package after this request is run. (Note: this does not mean it was a part of the package before; but, if it was, it isn't now) 17. Other requests17.1. rss-get-feed-dataRetrieves the raw data used to generate the Library's RSS feed. You can subscribe to the Library's RSS feed by visiting get RSS feed. Alternatively, you can used this LDS request to retrieve the same data as a REBOL object. In addition, there are some extra fields not supplied to the RSS readers.
17.1.1. response objecthas these fields:
17.1.2. response object/generation-infoHas these useful fields
17.1.3. response object/script-libraryIs a block of objects, one per script included in the RSS feed data.
17.1.4. response object/mailing-list-archiveIs a block of objects, one per included in the RSS feed data.
17.1.5. response object/newsIs a block of objects, one per news item included in the RSS feed data. News is the little snippets you can find on the top right of the REBOL.org home page.
17.1.6. Exampleprobe lds/send-server 'rss-get-feed-data [] 18. Token requestsUse these requests to work with your Library tokens. 18.1. token-testTest if your Library token works:
If the token is valid, you get your text back. If not, you get an error message about the token 18.1.1. Example:response-object: lds/send-server/use-token 'token-test ["any text"] 18.2. token-cancelCancels your current token. It will never work again.
18.2.1. Example:response-object: lds/send-server/use-token 'token-cancel [] 19. Random points and answers to NAQs (never-asked questions)19.1. Why not use LNS (Lightweight Network Services)?LDS predates LNS by a year, so LNS simply wasn't a possibility. It would be good to add an LNS interface to the Library. If any one wants to volunteer to help with that, please drop us a feedback message 19.2. Validation and verificationAll validation and verification of requests is done on REBOL.org. Lds-local does no parameter checking -- it simply passes the parameters you supply to REBOL.org. 19.3. SortingThe lists you get back from LDS are not usually not sorted. Any sequencing is purely accidental, and should not be relied on. LDS provides the data, it is your choice what order to handle or present it. One exception is the ''search-scripts request. The scripts-list it returns is sorted according to the relevance of the results: best fit first. 19.4. CachingEach time you call lds/send-server, it talks to the REBOL.org server. There is a case for caching results as many things do not change that often. It's on the upgrade list. 19.5. XMLI've been thinking of adding an XML refinement: lds/send-server/xml 'help none So what you get back is an XML page, not a REBOL object. Easy to do, but no point, unless anyone needs it. end |