Copy link to clipboard
Copied
Hey again. Straight to the point as i'm getting grey haired caused of this:
<cfscript>objMonkehTweet2 = createObject('component','cf_components.coldfumonkeh.monkehTweet').init('#get_info.user_name#','#ToString(BinaryDecode(get_info.pass_word, "base64"))#',true);
result2 = objMonkehTweet2.getUserDetails(id='#get_info.user_name#');
</cfscript>
<cfoutput>#result2.user.profile_image_url#</cfoutput>
<div id="twitter_label"><span style="float:left">Update IGES Twitter status:</span><span style="float:right"><a href="upd_news.cfm">add new slide</a></span></div>
<img name="" src="<cfoutput>#result2.user.profile_image_url#</cfoutput>" width="44" height="44" style="border:0; float:left" />
(script calls twitter API)
result:
As you see the script output displays correct path to the the image. However, exactly the same cfoutput inserted inside image tag produces this weird output with the whole address printed out and image tag end in the end. There are no " > or other similar symbols in the address as you can see so why?????
cheers,
Simon
Well, first question: do you want to pass back XML and then need to extract your URL value, or do you just want to pass back the URL by itself in the first place? There's arguments & use cases both ways.
As to how to extract it, it depends on what the possible content of that XML packet might be. Is its structure always going to be a single node with just the profile_image_url value? If so you can just access it directly with result2.user.profile_image_url.profile_image_url.xmlText.
Given the n
...Copy link to clipboard
Copied
Don't look at what's on the rendered output, look at what's in the HTML source the browser is trying to render.
That'll give you a clue as to what's going on.
--
Adam
Copy link to clipboard
Copied
sorry for a daft question but how do I do that?
Copy link to clipboard
Copied
Depends on the browser. In Firefox it's right-click anywhere in the main window and select "View Page Source". In IE it's the same, but "View Source". All browsers I know of have a similar option.
--
Adam
Copy link to clipboard
Copied
Sorry Cameron, I've got it. Just looked at the source of the page through IE and that's what I found:
<img name="" src="<?xml version="1.0" encoding="UTF-8"?>
So how do I extract the image address itself out of this thing?
Copy link to clipboard
Copied
Well, first question: do you want to pass back XML and then need to extract your URL value, or do you just want to pass back the URL by itself in the first place? There's arguments & use cases both ways.
As to how to extract it, it depends on what the possible content of that XML packet might be. Is its structure always going to be a single node with just the profile_image_url value? If so you can just access it directly with result2.user.profile_image_url.profile_image_url.xmlText.
Given the names of your variable there... I suspect you don't actually mean to be passing back an XML packet from that method for the value of the user.profile_image_url subkey. It looks like you only mean to be passing back the value...? So fixing that is probably going to be the best approach here.
--
Adam
Copy link to clipboard
Copied
cheers Adam, once again you've saved me some on headache pills.
Simon
Copy link to clipboard
Copied
No worries mate.
--
Adam