[Clipart] OpenClipart Api

Cameron Gregory public at bloke.com
Mon Apr 18 01:05:48 PDT 2011


We use the Ocal search at http://www.imagebot.com/
and came across a few errors like this.  I dropped the description 
before parsing the xml.
(search "help", "apple" are two examples).

here is an evil regex to get around the problem till it's encoded:

       str = get the xml ();
        str = str.replaceAll("[\r\n]"," 
").replaceAll("<description>.*?</description>","<description></description>");

of course, I'm guessing there is nothing to stop from someone putting 
</description> in the description and really hosing things up.

Cameron
Online SVG Editor: http://www.imagebot.com/

On 04/18/2011 04:33 PM, Fabricatorz Team wrote:
> Oh, we need to encode these. Please file as a bug: 
> http://bugs.launchpad.net/openclipart
>
> Cheers!
>
> On Mon, Apr 11, 2011 at 3:19 PM, James Bench <james at jbench.co.uk 
> <mailto:james at jbench.co.uk>> wrote:
>
>     Good evening again,
>
>     I've spent a few minutes throwing together a class to parse the
>     XML but I'm hitting a stumbling block with the XML being invalid,
>     in a search for cake one result is:
>
>     <item>
>              <title>Birthday Cake Fade</title>
>              <link>http://www.openclipart.org/detail/1242263456035.svg</link>
>
>              <pubDate>2010-04-24 21:31:59</pubDate>
>              <dc:creator>rejon</dc:creator>
>              <description>These are images from my 2010 travels I've converted with this command:
>
>     for i in *.jpg; do convert "$i" "`basename "$i" .jpg`.png"&&  autotrace -despeckle-level 15 -color-count 6 -input-format PNG -output-file "`basename "$i" .jpg`".svg -output-format svg "`basename "$i" .jpg`.png"; done</description>
>
>          <content:encoded><![CDATA[These are images from my 2010 travels I've converted with this command:
>
>     for i in *.jpg; do convert "$i" "`basename "$i" .jpg`.png"&&  autotrace -despeckle-level 15 -color-count 6 -input-format PNG -output-file "`basename "$i" .jpg`".svg -output-format svg "`basename "$i" .jpg`.png"; done]]></content:encoded>
>              <enclosure  url="http://www.openclipart.org/people/rejon/1242263456035.svg"type="octect/stream"></enclosure>
>              <guid>http://www.openclipart.org/detail/1242263456035.svg</guid>
>              <cc:license>http://creativecommons.org/licenses/publicdomain</cc:license>
>              <media:thumbnail  url="http://www.openclipart.org/image/90px/svg_to_png/1242263456035.png"></media:thumbnail>
>     </item>
>
>     The error is due the the &s in
>
>     for i in *.jpg; do convert "$i" "`basename "$i" .jpg`.png"&&  autotrace -despeckle-level 15 -color-count 6 -input-format PNG -output-file "`basename "$i" .jpg`".svg -output-format svg "`basename "$i" .jpg`.png"; done
>
>     not being escaped correctly, I'm happy to have a look and try to
>     fix this for you if you point me in the right direction or if you
>     can sort this for me that would also be great.
>
>
>     Cheers,
>
>     James Bench
>
>     Mob: 07882098806
>
>
>
>     On Mon, Apr 11, 2011 at 8:23 PM, James Bench <james at jbench.co.uk
>     <mailto:james at jbench.co.uk>> wrote:
>
>         Good evening,
>
>         Sorry about the delay, I've had a small play with the API and
>         think it'll be more than enough for what I'm wanting to do,
>         I've just got to find the time to get it done now, I also need
>         to check where I stand with Shutterstock and this, there TOS
>         forbid the integration of competitors products onto the site,
>         but as you guys are completely free I'm not convinced you
>         actually compete with Shutterstock, I also think I managed to
>         get exempted form that clause so I don't think it'll be an issue.
>
>         I'll try and spend some time on it over the next week.
>
>         I notice that you don't have any advertising on the site and
>         wondered if you'd be interested in a sponsorship deal to help
>         out with the cost of hosting and things, all I'd ask in return
>         is access to the API and a link on the main site.
>
>
>         Cheers,
>
>         James Bench
>
>         Mob: 07882098806
>
>
>
>         On Fri, Apr 8, 2011 at 7:02 AM, Fabricatorz Team
>         <info at fabricatorz.com <mailto:info at fabricatorz.com>> wrote:
>
>             James, anything cool come from this?
>
>             On Wed, Feb 23, 2011 at 8:47 PM, Bassel Safadi
>             <bassel.safadi at gmail.com <mailto:bassel.safadi at gmail.com>>
>             wrote:
>             > James,
>             > are you using this one:
>             > http://www.openclipart.org/api/search/?query=YOUR+QUERY
>             > this one is the pretty stable
>             >
>             > On Wed, Feb 23, 2011 at 8:58 PM, James Bench
>             <james at jbench.co.uk <mailto:james at jbench.co.uk>> wrote:
>             >>
>             >> Hi all,
>             >>
>             >> That's enough for what I currently want to do, is it
>             safe to use that API
>             >> or am I better to wait a few months for a new one?
>             >>
>             >> Cheers,
>             >>
>             >> James Bench
>             >>
>             >> Mob: 07882098806
>             >>
>             >>
>             >>
>             >> On Tue, Feb 22, 2011 at 9:37 PM, Fabricatorz Team
>             <info at fabricatorz.com <mailto:info at fabricatorz.com>>
>             >> wrote:
>             >>>
>             >>> Ask and ye shall receive! Chovynz what is our latest
>             API documentation?
>             >>> Feels out of date.
>             >>>
>             >>> HTTP://OPENCLIPART.org/wiki/API
>             >>>
>             >>> jon at fabricatorz.com <mailto:jon at fabricatorz.com>
>             >>> http://fabricatorz.com
>             >>>
>             >>> On Feb 22, 2011 11:57 AM, "James Bench"
>             <james at jbench.co.uk <mailto:james at jbench.co.uk>> wrote:
>             >>> > From: James Bench <james at jbench.co.uk
>             <mailto:james at jbench.co.uk>>
>             >>> > Subject: OpenClipart Api
>             >>> >
>             >>> > Message Body:
>             >>> > Hi,
>             >>> >
>             >>> > I run freevectors.net <http://freevectors.net> and
>             I'd like to include search results from
>             >>> > OpenClipart in the sites search results in a similar
>             way to how ShutterStock
>             >>> > are included (except they're free), are there
>             currently any plans for an API
>             >>> > that would allow this sort of integration?
>             >>> >
>             >>> > Cheers,
>             >>> >
>             >>> > James Bench
>             >>> >
>             >>> > --
>             >>> > This mail is sent via contact form on Fabricatorz
>             >>> > http://fabricatorz.com
>             >>> >
>             >>
>             >
>             >
>             >
>             > --
>             > Bassel Safadi
>             > http://bassel.ws
>             > http://aikilab.org
>             > Global +1 323-545-3855
>             > Singapore +65 93488349
>             >
>             >
>
>
>
>
>
>
> -- 
> http://fabricatorz.com
>
>
> _______________________________________________
> clipart mailing list
> clipart at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/clipart

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/clipart/attachments/20110418/9bd6e1b2/attachment.html>


More information about the clipart mailing list