Re: [Pharo-users] [Pharo-project] Pharocasts: Display Picasa photos
Cool, it's on Pharocasts ! Laurent On Mon, Aug 16, 2010 at 2:10 PM, Gary Chambers <gazzaguru2@btinternet.com>wrote:
Indeed, nice...
Here's an adaptation for Flickr...
| xmlStream xmlDoc photos builder clickBlock | xmlStream := ' http://api.flickr.com/services/feeds/photos_public.gne?id=12018791@N06&lang=...' asUrl retrieveContents contentStream. xmlDoc := XMLDOMParser parseDocumentFrom: xmlStream.
photos := OrderedCollection new. xmlDoc tagsNamed: #item do: [:item| | title thumbUrl photoUrl | title := (item firstTagNamed: #title) characterData. thumbUrl := ((item firstTagNamed: #media:thumbnail) attributeAt: #url) asUrl. photoUrl := ((item firstTagNamed: #media:content) attributeAt: #url) asUrl. photos add: title -> (Form fromBinaryStream: thumbUrl retrieveContents contentStream) -> photoUrl].
clickBlock := [:url :title | | scrollPane | scrollPane := GeneralScrollPane new scrollTarget: (builder newImage: (Form fromBinaryStream: url retrieveContents contentStream)). scrollPane openInWindow setLabel: title; extent: 600@400. scrollPane color: Color transparent].
builder := UITheme builder. ((builder newRow: (photos collect: [:aPhoto| (builder newButtonFor: clickBlock getState: nil action: #value:value: arguments: {aPhoto value. aPhoto key key} getEnabled: nil label: ((builder newColumn: { builder newImage: aPhoto key value. builder newLabel: aPhoto key key}) cellPositioning: #center; layoutInset: 10) help: nil)])) wrapDirection: #topToBottom; openInWindow) setLabel: (xmlDoc firstTagNamed: #title) characterData; extent: 700@680.
Regards, Gary
----- Original Message ----- From: "Germán Arduino" <garduino@gmail.com> To: <Pharo-project@lists.gforge.inria.fr> Cc: "A friendly place where any question about pharo is welcome" < pharo-users@lists.gforge.inria.fr> Sent: Sunday, August 15, 2010 11:14 PM Subject: Re: [Pharo-project] Pharocasts: Display Picasa photos
Excellent!
2010/8/15 laurent laffont <laurent.laffont@gmail.com>:
Learn: - how to get data from an URL - parse XML documents - build a GUI to display photos with Polymorph - how to prototype quickly with debugger and inspector
http://pharocasts.blogspot.com/2010/08/see-how-to-get-data-from-url-parse-xm... Cheers, Laurent Laffont
http://pharocasts.blogspot.com/ http://magaloma.blogspot.com/
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Hi. I wouldn't like to loose all this cool pieces of code. Even if they are not complete, they work as examples. It would be good to create a ss project like ExternalWebApplicationsCommunication or something like that where you post all this code, Gary's one, and I remember others from your posts or other emails.... 2010/8/16 laurent laffont <laurent.laffont@gmail.com>
Cool, it's on Pharocasts !
Laurent
On Mon, Aug 16, 2010 at 2:10 PM, Gary Chambers <gazzaguru2@btinternet.com>wrote:
Indeed, nice...
Here's an adaptation for Flickr...
| xmlStream xmlDoc photos builder clickBlock | xmlStream := ' http://api.flickr.com/services/feeds/photos_public.gne?id=12018791@N06&lang=...' asUrl retrieveContents contentStream. xmlDoc := XMLDOMParser parseDocumentFrom: xmlStream.
photos := OrderedCollection new. xmlDoc tagsNamed: #item do: [:item| | title thumbUrl photoUrl | title := (item firstTagNamed: #title) characterData. thumbUrl := ((item firstTagNamed: #media:thumbnail) attributeAt: #url) asUrl. photoUrl := ((item firstTagNamed: #media:content) attributeAt: #url) asUrl. photos add: title -> (Form fromBinaryStream: thumbUrl retrieveContents contentStream) -> photoUrl].
clickBlock := [:url :title | | scrollPane | scrollPane := GeneralScrollPane new scrollTarget: (builder newImage: (Form fromBinaryStream: url retrieveContents contentStream)). scrollPane openInWindow setLabel: title; extent: 600@400. scrollPane color: Color transparent].
builder := UITheme builder. ((builder newRow: (photos collect: [:aPhoto| (builder newButtonFor: clickBlock getState: nil action: #value:value: arguments: {aPhoto value. aPhoto key key} getEnabled: nil label: ((builder newColumn: { builder newImage: aPhoto key value. builder newLabel: aPhoto key key}) cellPositioning: #center; layoutInset: 10) help: nil)])) wrapDirection: #topToBottom; openInWindow) setLabel: (xmlDoc firstTagNamed: #title) characterData; extent: 700@680.
Regards, Gary
----- Original Message ----- From: "Germán Arduino" <garduino@gmail.com> To: <Pharo-project@lists.gforge.inria.fr> Cc: "A friendly place where any question about pharo is welcome" < pharo-users@lists.gforge.inria.fr> Sent: Sunday, August 15, 2010 11:14 PM Subject: Re: [Pharo-project] Pharocasts: Display Picasa photos
Excellent!
2010/8/15 laurent laffont <laurent.laffont@gmail.com>:
Learn: - how to get data from an URL - parse XML documents - build a GUI to display photos with Polymorph - how to prototype quickly with debugger and inspector
http://pharocasts.blogspot.com/2010/08/see-how-to-get-data-from-url-parse-xm... Cheers, Laurent Laffont
http://pharocasts.blogspot.com/ http://magaloma.blogspot.com/
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
HelpSystem may be more appropriate ? Laurent 2010/8/16 Mariano Martinez Peck <marianopeck@gmail.com>
Hi. I wouldn't like to loose all this cool pieces of code. Even if they are not complete, they work as examples. It would be good to create a ss project like ExternalWebApplicationsCommunication or something like that where you post all this code, Gary's one, and I remember others from your posts or other emails....
2010/8/16 laurent laffont <laurent.laffont@gmail.com>
Cool, it's on Pharocasts !
Laurent
On Mon, Aug 16, 2010 at 2:10 PM, Gary Chambers <gazzaguru2@btinternet.com
wrote:
Indeed, nice...
Here's an adaptation for Flickr...
| xmlStream xmlDoc photos builder clickBlock | xmlStream := ' http://api.flickr.com/services/feeds/photos_public.gne?id=12018791@N06&lang=...' asUrl retrieveContents contentStream. xmlDoc := XMLDOMParser parseDocumentFrom: xmlStream.
photos := OrderedCollection new. xmlDoc tagsNamed: #item do: [:item| | title thumbUrl photoUrl | title := (item firstTagNamed: #title) characterData. thumbUrl := ((item firstTagNamed: #media:thumbnail) attributeAt: #url) asUrl. photoUrl := ((item firstTagNamed: #media:content) attributeAt: #url) asUrl. photos add: title -> (Form fromBinaryStream: thumbUrl retrieveContents contentStream) -> photoUrl].
clickBlock := [:url :title | | scrollPane | scrollPane := GeneralScrollPane new scrollTarget: (builder newImage: (Form fromBinaryStream: url retrieveContents contentStream)). scrollPane openInWindow setLabel: title; extent: 600@400. scrollPane color: Color transparent].
builder := UITheme builder. ((builder newRow: (photos collect: [:aPhoto| (builder newButtonFor: clickBlock getState: nil action: #value:value: arguments: {aPhoto value. aPhoto key key} getEnabled: nil label: ((builder newColumn: { builder newImage: aPhoto key value. builder newLabel: aPhoto key key}) cellPositioning: #center; layoutInset: 10) help: nil)])) wrapDirection: #topToBottom; openInWindow) setLabel: (xmlDoc firstTagNamed: #title) characterData; extent: 700@680.
Regards, Gary
----- Original Message ----- From: "Germán Arduino" <garduino@gmail.com> To: <Pharo-project@lists.gforge.inria.fr> Cc: "A friendly place where any question about pharo is welcome" < pharo-users@lists.gforge.inria.fr> Sent: Sunday, August 15, 2010 11:14 PM Subject: Re: [Pharo-project] Pharocasts: Display Picasa photos
Excellent!
2010/8/15 laurent laffont <laurent.laffont@gmail.com>:
Learn: - how to get data from an URL - parse XML documents - build a GUI to display photos with Polymorph - how to prototype quickly with debugger and inspector
http://pharocasts.blogspot.com/2010/08/see-how-to-get-data-from-url-parse-xm... Cheers, Laurent Laffont
http://pharocasts.blogspot.com/ http://magaloma.blogspot.com/
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
I think that a chapter on fun scripting the web with pharo would be better than an help. Stef On Aug 16, 2010, at 3:14 PM, laurent laffont wrote:
HelpSystem may be more appropriate ?
Laurent
2010/8/16 Mariano Martinez Peck <marianopeck@gmail.com> Hi. I wouldn't like to loose all this cool pieces of code. Even if they are not complete, they work as examples. It would be good to create a ss project like ExternalWebApplicationsCommunication or something like that where you post all this code, Gary's one, and I remember others from your posts or other emails....
2010/8/16 laurent laffont <laurent.laffont@gmail.com>
Cool, it's on Pharocasts !
Laurent
On Mon, Aug 16, 2010 at 2:10 PM, Gary Chambers <gazzaguru2@btinternet.com> wrote: Indeed, nice...
Here's an adaptation for Flickr...
| xmlStream xmlDoc photos builder clickBlock | xmlStream := 'http://api.flickr.com/services/feeds/photos_public.gne?id=12018791@N06&lang=...' asUrl retrieveContents contentStream. xmlDoc := XMLDOMParser parseDocumentFrom: xmlStream.
photos := OrderedCollection new. xmlDoc tagsNamed: #item do: [:item| | title thumbUrl photoUrl | title := (item firstTagNamed: #title) characterData. thumbUrl := ((item firstTagNamed: #media:thumbnail) attributeAt: #url) asUrl. photoUrl := ((item firstTagNamed: #media:content) attributeAt: #url) asUrl. photos add: title -> (Form fromBinaryStream: thumbUrl retrieveContents contentStream) -> photoUrl].
clickBlock := [:url :title | | scrollPane | scrollPane := GeneralScrollPane new scrollTarget: (builder newImage: (Form fromBinaryStream: url retrieveContents contentStream)). scrollPane openInWindow setLabel: title; extent: 600@400. scrollPane color: Color transparent].
builder := UITheme builder. ((builder newRow: (photos collect: [:aPhoto| (builder newButtonFor: clickBlock getState: nil action: #value:value: arguments: {aPhoto value. aPhoto key key} getEnabled: nil label: ((builder newColumn: { builder newImage: aPhoto key value. builder newLabel: aPhoto key key}) cellPositioning: #center; layoutInset: 10) help: nil)])) wrapDirection: #topToBottom; openInWindow) setLabel: (xmlDoc firstTagNamed: #title) characterData; extent: 700@680.
Regards, Gary
----- Original Message ----- From: "Germán Arduino" <garduino@gmail.com> To: <Pharo-project@lists.gforge.inria.fr> Cc: "A friendly place where any question about pharo is welcome" <pharo-users@lists.gforge.inria.fr> Sent: Sunday, August 15, 2010 11:14 PM Subject: Re: [Pharo-project] Pharocasts: Display Picasa photos
Excellent!
2010/8/15 laurent laffont <laurent.laffont@gmail.com>: Learn: - how to get data from an URL - parse XML documents - build a GUI to display photos with Polymorph - how to prototype quickly with debugger and inspector http://pharocasts.blogspot.com/2010/08/see-how-to-get-data-from-url-parse-xm... Cheers, Laurent Laffont
http://pharocasts.blogspot.com/ http://magaloma.blogspot.com/
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
participants (3)
-
laurent laffont -
Mariano Martinez Peck -
Stéphane Ducasse