Premshree Pillai ([info]premshree) wrote,
@ 2005-03-04 03:39:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Current music:Animals - House Of The Rising Sun
Entry tags:api, hacks, rebol, web services, yahoo, yahoo api, yahoo hacks

What about REBOL?

Yahoo! Search Web Services demo using REBOL

Heh, REBOL is fun at times. Somebody asked me that question—“What about REBOL?”. Um, I don’t think I’m going to find time to write an API or anything. Basically I’m not in any mood to add parse handlers for the various search types.

Well, there you go, a Yahoo! Search Web Services demo for REBOL. That’s about REBOL.

REBOL code »

REBOL [
	Title:  "Yahoo Search Web Services"
	File:  %amazon.r
	Date:  4-Mar-2005
	Author: "Premshree Pillai"

	Purpose: {
		Yahoo! Search Web services demo
	}
]

do %xml-parse.r

APP_ID: 'rebol-yahoo'

ImageSearch: func [query app_id] [
	return parse-xml+ read rejoin [http://api.search.yahoo.com/ImageSearchService/V1/imageSearch '?query=' query '&appid=' app_id]
]

out: layout [
	H3 400 {
		Yahoo Search Web Services
		demo using REBOL
	}
	across
	query: field
	button "Search" [
		ImageSearchResults: ImageSearch query/text 'rebol-yahoo' APP_ID
		curr_count: 1
		img: load to-url ImageSearchResults/:curr_count/3/2
		backface/image: img
		show backface
	]
	return
	backface: text 400x300 center
	return
	button "Previous" [
		curr_count: curr_count - 1
		img: load to-url ImageSearchResults/:curr_count/3/2
		backface/image: img
		show backface
	]
	button "Next" [
		curr_count: curr_count + 1
		img: load to-url ImageSearchResults/:curr_count/3/2
		backface/image: img
		show backface
	]
	pad 0x5
]

view out

The screenshot was generated using REBOL itself: save/png %screenshot.png to-image out



(Post a new comment)

Nice
[info]webfiend
2005-03-04 02:42 am UTC (link)
Freakishly short, too. One of the things I admire about a lot of REBOL code. Oh and hey, there's xml-parse.r! :-)

(Reply to this)


[info]webfiend
2005-03-04 02:54 am UTC (link)
Oh, and would you mind sending me a copy of your version of xml-parse.r? I think my attempts to fix my copy sort of ... um ... broke it. Which means that what I put on rebol.org won't work for other users.

(Reply to this)(Thread)


[info]premshree
2005-03-04 07:36 am UTC (link)
I have a copy here.

(Reply to this)(Parent)

Egoistic rant...
(Anonymous)
2005-03-11 11:11 am UTC (link)
Hey, did you go for the concert?
Cause I did ;-)

(Reply to this)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…