Forum OpenACS Q&A: How to create a simple 3rd party web service?
Suppose you have an OpenACS module that delivers some data and you want to enable other web sites to embed that content within a page of their own design, much as if they were embedding an image whose source is your OpenACS site. And suppose the key feature is that to accomplish this must require virtually no effort or maintenance on the part of the other web site; they should be able to edit their page once to point to the OpenACS module (ie tcl page) and then forget about it.
What is the best mechanism to accompish this?
- Is this what RSS is for? (Jerry's thread https://openacs.org/bboard/q-and-a-fetch-msg.tcl?msg_id=00039N&topic_id=11&topic=OpenACS seems relevant.)
- Can one point to an tcl page in an <object> tag and get this to work as if it were a java applet?
- Is there some other obvious way to do this?
But there are a couple of steps that are just not there yet. You write, "much as if they were embedding an image whose source is your OpenACS site". That's a tough one. Embedding an image is a simple as sticking in a url, right? Well to all of our great regret, there is no such thing as a client-side, html include file, and so you need something on the other side, either client browser or web server to read the published data and stick it into the client's browser's document.
set result [getallmyinfo ... ] ns_write "document.write('$result');"Thats all there is to it. I'm amazed.
BTW, you could add a lot of value by wrapping DIV tags around
the content so that your consumers can style the content any
way they'd like.
regsubout the ctrl-m's.
And thx for pointing out the additional subtleties.
In particular, if what the OpenACS server injects into the page is links to various other sites, would Google count those links as coming from the static page site or from the OpenACS site when calculating its notion of "page relevance"?
What I'm noodling with here is a concept of a centrally-managed DB-stored set of links that allied organizations who run simple static sites could incorporate into their pages in order to provide Google with a mutually-pointing, interconnecting set of links to push up their Google "scores".
Think this would work? Seems to me that this is could be a simple but nifty little web service for networks of organizations.