<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Patrick, I think the goal is to strip the path info out of the xml, leaving the picture_name.format.<br><br>Dave<br><br><hr id="stopSpelling">Subject: RE: [Xerte] how to strip out a specific string?<br>Date: Mon, 13 Apr 2009 09:52:59 +0100<br>From: Patrick.Lockley@nottingham.ac.uk<br>To: xerte@lists.nottingham.ac.uk<br><br>
<style>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Verdana;}
</style>
<div id="EC_idOWAReplyText87628" dir="ltr">
<div dir="ltr"><font size="2" color="#000000" face="Arial">If you want to jpeg path</font></div>
<div dir="ltr"><font face="Arial"></font> </div>
<div dir="ltr"><font face="Arial">it would be something near </font></div>
<div dir="ltr"><font face="Arial"></font> </div>
<div dir="ltr"><font face="Arial">var reg = new regExp;</font></div>
<div dir="ltr"><font face="Arial"></font> </div>
<div dir="ltr"><font face="Arial">reg = "$<font size="3">href="</font><a href="http://s3.amazonaws.com/twitter_production/profile_images/96243182/Photo14_normal.jpg"><font size="3"></font></a><font size="3"><a href="http://%5BA-Za-z0-9%5D*.amazonaws.com/twitter_production/profile_images/%5B0-9%5D*/%5BA-Za-z0-9_-%5D*.jpg%22/">http://[A-Za-z0-9]*.amazonaws.com/twitter_production/profile_images/[0-9]*/[A-Za-z0-9_-]*.jpg</a></font><font size="3">"/>"</font></font></div>
<div dir="ltr"><font size="3" face="Arial"></font> </div>
<div dir="ltr"><font size="3" face="Arial">But thats not been tested.</font></div></div>
<div dir="ltr"><br>
<hr>
<font size="2" face="Tahoma"><b>From:</b> xerte-bounces@lists.nottingham.ac.uk on behalf of Dave Burnett<br><b>Sent:</b> Mon 13/04/2009 02:16<br><b>To:</b> Xerte list<br><b>Subject:</b> RE: [Xerte] how to strip out a specific string?<br></font><br></div>
<div><br><br>I could be imagining things, but I thought Julian just posted something about Regular Expressions now being supported.<br><br>If that is true, then this would work:<br><br>new_xml = replace(original_xml, /the_string_here/g, "");<br><br>the /g at the end if the string parameter means "global", so it would replace all the instances of that URL with "".<br><br>Dave<br><br><br>
<hr id="EC_stopSpelling">
From: ronm@mitchellmedia.co.uk<br>To: xerte@lists.nottingham.ac.uk<br>Subject: Re: [Xerte] how to strip out a specific string?<br>Date: Sun, 12 Apr 2009 20:19:55 +0100<br><br>
<div>Cheers Dave that's very helpful - I'll give that a try.</div><br>
<div>
<div>On 12 Apr 2009, at 19:35, Dave Burnett wrote:</div><br class="EC_EC_Apple-interchange-newline">
<blockquote><span class="EC_EC_Apple-style-span" style="word-spacing: 0px; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; text-transform: none; color: rgb(0, 0, 0); text-indent: 0px; white-space: normal; letter-spacing: normal; border-collapse: separate;">
<div class="EC_EC_hmmessage" style="font-size: 10pt; font-family: Verdana;"><br>It actually does have a closing tag: /><br><br>XML shorthands the closing tag to save characters when all the info is contained in the attributes, i.e. there is no actual value between the tags.<br><br><span style="font-size: 11pt; font-family: Arial,sans-serif;"><name>jamesclay (James Clay)</name> //no attributes, data between tags<br><br><br></span><span style="font-size: 11pt; font-family: Arial,sans-serif;"><link type="text/html" rel="alternate" href="<a href="http://twitter.com/jamesclay/statuses/1483252089">http://twitter.com/jamesclay/statuses/1483252089</a>"/><br><br>//all data in opening tag attributes, no explicit closing tag, just /><br><br></span><br>So if you know the format you show below would be consistent, you could key on that "/>" as the end of the string and RFind (reverse find) back to the first "/" you hit.<br><br>That should isolate the actual picture name/format.<br><br>Dave<br><br><br>
<hr id="EC_EC_stopSpelling">
From:<span class="EC_EC_Apple-converted-space"> </span><a href="mailto:ronm@mitchellmedia.co.uk">ronm@mitchellmedia.co.uk</a><br>To:<span class="EC_EC_Apple-converted-space"> </span><a href="mailto:xerte@lists.nottingham.ac.uk">xerte@lists.nottingham.ac.uk</a><br>Date: Sun, 12 Apr 2009 19:22:22 +0100<br>Subject: [Xerte] how to strip out a specific string?<br><br>
<div class="EC_EC_EC_Section1">
<div>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">Hi all</span></div>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">I've been experimenting with the new module method of creating templates and have created a couple of new templates optimised for a specific purpose which I’ll happily share with the community once complete. One is an optimised view of twitter feeds but unless I’m mistaken it seems like the xml isn't complete for some reason. I can pick up and display the text and links etc ok but I can't work out how to access the profile pics. Here's an example entry...</span></div>
<p class="EC_EC_EC_MsoPlainText" style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"></span> </p>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"><entry></span></div>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"> <id>tag:search.twitter.com,2005:1483252089</id></span></div>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"> <published>2009-04-09T12:59:26Z</published></span></div>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"> <link type="text/html" rel="alternate" href="<a href="http://twitter.com/jamesclay/statuses/1483252089">http://twitter.com/jamesclay/statuses/1483252089</a>"/></span></div>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"> <title>@ronm123 I meant in a browser, via a second projector probably.</title></span></div>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"> <content type="html">&lt;a href="<a href="http://twitter.com/ronm123">http://twitter.com/ronm123</a>"&gt;@ronm123&lt;/a&gt; I meant in a browser, via a second projector probably.</content></span></div>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"> <updated>2009-04-09T12:59:26Z</updated></span></div>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"> <link type="image/png" rel="image" href="<a href="http://s3.amazonaws.com/twitter_production/profile_images/96243182/Photo14_normal.jpg">http://s3.amazonaws.com/twitter_production/profile_images/96243182/Photo14_normal.jpg</a>"/></span></div>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"> <twitter:source>&lt;a href="<a href="http://twitter.com/">http://twitter.com/</a>"&gt;web&lt;/a&gt;</twitter:source></span></div>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"> <author></span></div>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"> <name>jamesclay (James Clay)</name></span></div>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"> <uri><a href="http://twitter.com/jamesclay%3C/uri">http://twitter.com/jamesclay</uri</a>></span></div>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"> </author></span></div>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"> </entry></span></div>
<p class="EC_EC_EC_MsoPlainText" style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"></span> </p>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">I want to be able to strip out the path to the .jpg e.g.<a href="http://s3.amazonaws.com/twitter_production/profile_images/96243182/Photo14_normal.jpg">http://s3.amazonaws.com/twitter_production/profile_images/96243182/Photo14_normal.jpg</a></span></div>
<p class="EC_EC_EC_MsoPlainText" style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"></span> </p>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">But can't work out how to do that. I can access the content of <id>,<title> and even <name> but the tag containing the profile pic link e.g. <link type=”image/png” doesn’t have a closing tag. Presumably I need some kind of function + regular expression - any suggestions?</span></div>
<p class="EC_EC_EC_MsoNormal" style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;"></span> </p>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">Cheers</span></div>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">Ron<span style="color: rgb(31, 73, 125);"></span></span></div></div></div><br>
<hr>
Rediscover Hotmail®: Get e-mail storage that grows with you.<span class="EC_EC_Apple-converted-space"> </span><a href="http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage1_042009">Check it out.</a>_______________________________________________<br>Xerte mailing list<br><a href="mailto:Xerte@lists.nottingham.ac.uk">Xerte@lists.nottingham.ac.uk</a><br><a href="http://lists.nottingham.ac.uk/mailman/listinfo/xerte">http://lists.nottingham.ac.uk/mailman/listinfo/xerte</a><br></div></span></blockquote></div><br><br>
<hr>
Rediscover Hotmail®: Now available on your iPhone or BlackBerry <a href="http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile1_042009">Check it out.</a> </div><br /><hr />Rediscover Hotmail®: Now available on your iPhone or BlackBerry <a href='http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile1_042009' target='_new'>Check it out.</a></body>
</html>