Getting example images - https://picsum.photos
Hi, This is a cool service: https://picsum.photos - it gives you example images (pictures/photos). Here is how you can use this from a standard Pharo image (no pun intended). ZnEasy getJpeg: 'https://picsum.photos/512'. ImageReadWriter formFromStream: (ZnClient new systemPolicy; url: 'https://picsum.photos/640/480?grayscale'; accept: ZnMimeType imagePng; get) readStream. Sven
I remember Paul de Bruicker (cc'ed) used a similar service to get user profiles (with first and last name and pictures, so you can "simulate" users in your app, and you could ask for male or female profiles). I don't remember the name, hopefully he will :) Esteban A. Maringolo On Mon, Apr 29, 2019 at 8:24 AM Sven Van Caekenberghe <sven@stfx.eu> wrote:
Hi,
This is a cool service: https://picsum.photos - it gives you example images (pictures/photos).
Here is how you can use this from a standard Pharo image (no pun intended).
ZnEasy getJpeg: 'https://picsum.photos/512'.
ImageReadWriter formFromStream: (ZnClient new systemPolicy; url: 'https://picsum.photos/640/480?grayscale'; accept: ZnMimeType imagePng; get) readStream.
Sven
https://uinames.com/ The api is a GET e.g. https://uinames.com/api?region=germany&gender=female & returns JSON with image url and plausible name among other things. -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
Ah, also quite interesting. With the latest Zn loaded: Metacello new repository: 'github://svenvc/zinc/repository'; baseline: 'ZincHTTPComponents'; load. You can do: ZnClient new systemPolicy; forJsonREST; url: 'https://uinames.com/api'; queryAt: #region put: #germany; queryAt: #gender put: #female; get.
a Dictionary('gender'->'female' 'name'->'Fabienne' 'region'->'Germany' 'surname'->'Schuster' )
On 29 Apr 2019, at 20:03, Paul DeBruicker <pdebruic@gmail.com> wrote:
The api is a GET e.g.
https://uinames.com/api?region=germany&gender=female
& returns JSON with image url and plausible name among other things.
-- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
I forgot the "ext" query parameter which gives the image urls so ZnClient new systemPolicy; forJsonREST; url: 'https://uinames.com/api'; queryAt: #region put: #germany; queryAt: #gender put: #female; queryAt:#ext put: nil; get. -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
Pretty cool! This is how you get a Pharo image working, with pun intended ;-): http://ws.stfx.eu/7WN9SG9YBB6E Cheers, Offray On 29/04/19 6:23 a. m., Sven Van Caekenberghe wrote:
Hi,
This is a cool service: https://picsum.photos - it gives you example images (pictures/photos).
Here is how you can use this from a standard Pharo image (no pun intended).
ZnEasy getJpeg: 'https://picsum.photos/512'.
ImageReadWriter formFromStream: (ZnClient new systemPolicy; url: 'https://picsum.photos/640/480?grayscale'; accept: ZnMimeType imagePng; get) readStream.
Sven
Perfect, I should have looked at the list of available images ... great catch.
On 29 Apr 2019, at 18:42, Offray Vladimir Luna Cárdenas <offray.luna@mutabit.com> wrote:
Pretty cool!
This is how you get a Pharo image working, with pun intended ;-):
http://ws.stfx.eu/7WN9SG9YBB6E
<hopdbmfikdhjmimg.png>
Cheers,
Offray
On 29/04/19 6:23 a. m., Sven Van Caekenberghe wrote:
Hi,
This is a cool service: https://picsum.photos - it gives you example images (pictures/photos).
Here is how you can use this from a standard Pharo image (no pun intended).
ZnEasy getJpeg: ' https://picsum.photos/512 '.
ImageReadWriter formFromStream: (ZnClient new systemPolicy; url: ' https://picsum.photos/640/480?grayscale '; accept: ZnMimeType imagePng; get) readStream.
Sven
Am 29.04.2019 um 13:23 schrieb Sven Van Caekenberghe:
Hi,
This is a cool service: https://picsum.photos - it gives you example images (pictures/photos).
Here is how you can use this from a standard Pharo image (no pun intended).
ZnEasy getJpeg: 'https://picsum.photos/512'.
ImageReadWriter formFromStream: (ZnClient new systemPolicy; url: 'https://picsum.photos/640/480?grayscale'; accept: ZnMimeType imagePng; get) readStream.
Sven
Picsum is listed here <https://github.com/toddmotto/public-apis> along with a number of other public APIs. Maybe this overview list is interesting for one or the other. Franz Josef
This makes me remember when I was working doing android mobile apps: there is a kitten placeholder service too. https://placekitten.com/ And status codes too https://http.cat/ ZnEasy getJpeg: 'https://placekitten.com/200/300'. :) On Wed, May 1, 2019 at 10:41 AM Franz Josef Konrad <franzl@fjkonrad.de> wrote:
Am 29.04.2019 um 13:23 schrieb Sven Van Caekenberghe:
Hi,
This is a cool service: https://picsum.photos - it gives you example images (pictures/photos).
Here is how you can use this from a standard Pharo image (no pun intended).
ZnEasy getJpeg: 'https://picsum.photos/512'.
ImageReadWriter formFromStream: (ZnClient new systemPolicy; url: 'https://picsum.photos/640/480?grayscale'; accept: ZnMimeType imagePng; get) readStream.
Sven
Picsum is listed here <https://github.com/toddmotto/public-apis> along with a number of other public APIs. Maybe this overview list is interesting for one or the other.
Franz Josef
-- Guille Polito Research Engineer Centre de Recherche en Informatique, Signal et Automatique de Lille CRIStAL - UMR 9189 French National Center for Scientific Research - *http://www.cnrs.fr <http://www.cnrs.fr>* *Web:* *http://guillep.github.io* <http://guillep.github.io> *Phone: *+33 06 52 70 66 13
On 2 May 2019, at 11:12, Guillermo Polito <guillermopolito@gmail.com> wrote:
This makes me remember when I was working doing android mobile apps: there is a kitten placeholder service too.
And status codes too
ZnEasy getJpeg: 'https://placekitten.com/200/300'.
:)
That is obviously better !
On Wed, May 1, 2019 at 10:41 AM Franz Josef Konrad <franzl@fjkonrad.de> wrote: Am 29.04.2019 um 13:23 schrieb Sven Van Caekenberghe:
Hi,
This is a cool service: https://picsum.photos - it gives you example images (pictures/photos).
Here is how you can use this from a standard Pharo image (no pun intended).
ZnEasy getJpeg: 'https://picsum.photos/512'.
ImageReadWriter formFromStream: (ZnClient new systemPolicy; url: 'https://picsum.photos/640/480?grayscale'; accept: ZnMimeType imagePng; get) readStream.
Sven
Picsum is listed here <https://github.com/toddmotto/public-apis> along with a number of other public APIs. Maybe this overview list is interesting for one or the other.
Franz Josef
--
Guille Polito Research Engineer
Centre de Recherche en Informatique, Signal et Automatique de Lille CRIStAL - UMR 9189 French National Center for Scientific Research - http://www.cnrs.fr
Web: http://guillep.github.io Phone: +33 06 52 70 66 13
participants (6)
-
Esteban Maringolo -
Franz Josef Konrad -
Guillermo Polito -
Offray Vladimir Luna Cárdenas -
Paul DeBruicker -
Sven Van Caekenberghe