(HTTPSocket httpGet: aUrl) contents<br><br>I know we Smalltalkers like to talk about how no one ever gets confused about dynamic types, but it does happen ;-).<br><br>The stream has the text you want. May want to familiarize yourself with core methods on the Stream hierarchy.<br>
<br>Pushing the Stream through a ByteArray conversion is invoking printString.<br><br>Your trouble with getting a modified string using replaceAll: is again a subtle typing error:<br><br>Reading the comment for #replaceAll:with:<br>
&quot;Replace all occurences of oldObject with newObject&quot;<br><br>But, Strings are collections of characters, not strings. Compare:<br><br>&#39;foo&#39; replaceAll: &#39;f&#39; with: &#39;g&#39; <br>&#39;foo&#39; replaceAll:  $f with: $g  <br>
<br>Take a look at senders of #findString: <br><br>Many of them do replacements of substrings.<br><br>David Mitchell<br><a href="http://www.withaguide.com">http://www.withaguide.com</a><br><br><div class="gmail_quote">On Wed, Mar 24, 2010 at 12:44 AM, sergio_101 <span dir="ltr">&lt;<a href="mailto:sergiolist@village-buzz.com">sergiolist@village-buzz.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">i am currently using HTTPSocket to pull data from a url...<br>
<br>
looks like this:<br>
<br>
        | data |<br>
        data := String<br>
                                fromByteArray: (HTTPSocket httpGet: anUrl).<br>
<br>
i end up with a string that has my desired data (a JSON string), but,<br>
it&#39;s preceeded by this:<br>
<br>
&#39;a RWBinaryOrTextStream &#39; &#39;&lt;here is the stuff i need&gt;&#39; &#39; &#39;<br>
<br>
i am trying to lop off the first part by doing:<br>
<br>
jsonData := dataString replaceAll:  &#39;RWBinaryOrTextStream&#39; with: &#39;test&#39;.<br>
<br>
just to see if i can touch the string..<br>
<br>
but no matter what i do, i can&#39;t get any parts of the string to be raplaced..<br>
<br>
it almost looks like there are three strings in there..<br>
<br>
the RWBinaryOrTextStream one, the one i need, and an empty one..<br>
<br>
is there a better way to pull a url?<br>
<br>
thanks!<br>
<br>
<br>
--<br>
<br>
----<br>
peace,<br>
sergio<br>
photographer, journalist, visionary<br>
<br>
<a href="http://www.coffee-black.com" target="_blank">http://www.coffee-black.com</a><br>
<a href="http://www.painlessfrugality.com" target="_blank">http://www.painlessfrugality.com</a><br>
<a href="http://www.twitter.com/sergio_101" target="_blank">http://www.twitter.com/sergio_101</a><br>
<a href="http://www.facebook.com/sergio101" target="_blank">http://www.facebook.com/sergio101</a><br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br>
</blockquote></div><br>