<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>&nbsp;</div>
<div dir="ltr"><font face="Arial">it would be something near </font></div>
<div dir="ltr"><font face="Arial"></font>&nbsp;</div>
<div dir="ltr"><font face="Arial">var reg = new regExp;</font></div>
<div dir="ltr"><font face="Arial"></font>&nbsp;</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">"/&gt;"</font></font></div>
<div dir="ltr"><font size="3" face="Arial"></font>&nbsp;</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: /&gt;<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;">&lt;name&gt;jamesclay (James Clay)&lt;/name&gt; //no attributes, data between tags<br><br><br></span><span style="font-size: 11pt; font-family: Arial,sans-serif;">&lt;link type="text/html" rel="alternate" href="<a href="http://twitter.com/jamesclay/statuses/1483252089">http://twitter.com/jamesclay/statuses/1483252089</a>"/&gt;<br><br>//all data in opening tag attributes, no explicit closing tag, just /&gt;<br><br></span><br>So if you know the format you show below would be consistent, you could key on that "/&gt;" 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">&nbsp;</span><a href="mailto:ronm@mitchellmedia.co.uk">ronm@mitchellmedia.co.uk</a><br>To:<span class="EC_EC_Apple-converted-space">&nbsp;</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 &nbsp;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>&nbsp;</p>
<div style="padding: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"><span style="font-size: 11pt; font-family: Arial,sans-serif;">&lt;entry&gt;</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;">&nbsp;&nbsp;&nbsp; &lt;id&gt;tag:search.twitter.com,2005:1483252089&lt;/id&gt;</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;">&nbsp;&nbsp;&nbsp; &lt;published&gt;2009-04-09T12:59:26Z&lt;/published&gt;</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;">&nbsp;&nbsp;&nbsp; &lt;link type="text/html" rel="alternate" href="<a href="http://twitter.com/jamesclay/statuses/1483252089">http://twitter.com/jamesclay/statuses/1483252089</a>"/&gt;</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;">&nbsp;&nbsp;&nbsp; &lt;title&gt;@ronm123 I meant in a browser, via a second projector probably.&lt;/title&gt;</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;">&nbsp;&nbsp;&nbsp; &lt;content type="html"&gt;&amp;lt;a href="<a href="http://twitter.com/ronm123">http://twitter.com/ronm123</a>"&amp;gt;@ronm123&amp;lt;/a&amp;gt; I meant in a browser, via a second projector probably.&lt;/content&gt;</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;">&nbsp;&nbsp;&nbsp; &lt;updated&gt;2009-04-09T12:59:26Z&lt;/updated&gt;</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;">&nbsp;&nbsp;&nbsp; &lt;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>"/&gt;</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;">&nbsp;&nbsp;&nbsp; &lt;twitter:source&gt;&amp;lt;a href="<a href="http://twitter.com/">http://twitter.com/</a>"&amp;gt;web&amp;lt;/a&amp;gt;&lt;/twitter:source&gt;</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;">&nbsp;&nbsp;&nbsp; &lt;author&gt;</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;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;name&gt;jamesclay (James Clay)&lt;/name&gt;</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;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;uri&gt;<a href="http://twitter.com/jamesclay%3C/uri">http://twitter.com/jamesclay&lt;/uri</a>&gt;</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;">&nbsp;&nbsp;&nbsp; &lt;/author&gt;</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;">&nbsp; &lt;/entry&gt;</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>&nbsp;</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>&nbsp;</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 &lt;id&gt;,&lt;title&gt; and even &lt;name&gt; but the tag containing the profile pic link e.g. &lt;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>&nbsp;</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">&nbsp;</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>