[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

Get image path from RSS feed and save to sql database.

Asked by Qsorb in ColdFusion Application Server, Cold Fusion Markup Language

RSS feeds such as Yahoo.com that contain images, I'd like to save the img src image path from the feed to a database.

I'm already saving the feeditems TITLE, DATE and CONTENT into separate columns and I can identify if there's an image in the CONTENT but understanding how to get the url path is beyond me.

Each feed has about 20 different stories and 20 different images.

There are many more feeds other than Yahoo so we can't just use it as a model. The solution should include a method to get the full src parameters and the image path for any RSS story that contains an image.

An example yahoo image path is:

http://d.yimg.com/a/p/ap/20090830/capt.c6dc2bf1604347cc94d5258779fd5c65.china_myanmar_xhg106.jpg

The image information and path is contained in feeditems.content. But how do I get that path out and save it?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
<cffeed source="http://rss.news.yahoo.com/rss/world" query="feeditems">
 
<cfoutput query="feeditems"><br />
 
  <cfquery name="qStory" datasource="daily-news">
   select pubdate
   from story
   where title = '#trim(feeditems.title)#'
   and catid = #catid#
  </cfquery>
 
<!--- Example image path and src values below --->
<!--- Note the &#60; preceding the img. -->
 
&#60;img src="http://d.yimg.com/a/p/ap/20090830/capt.c6dc2bf1604347cc94d5258779fd5c65.china_myanmar_xhg106.jpg?x=130&amp;y=86&amp;q=85&amp;sig=jWbG4FEQuphsL_zAvjm.uw--" align="left" height="86" width="130" alt="Chinese paramilitary police patrol the grounds of a temporary refugee camp set up by the Chinese government to house Myanmar refugees in Nansan in southwestern China&#039;s Yunnan province, Saturday, Aug. 29, 2009. Thousands of refugees have fled across the Chinese border to escape fighting between government troops and ethnic militia in Myanmar&#039;s Kokang region.  (AP Photo/Ng Han Guan)" border="0" />
   
<cfset pubdate = '#dateformat(qStory.pubdate,"m/dd/yyyy")# #timeformat(qStory.pubdate,"hh:mm:ss tt")#'>
 
<cfif NOT qStory.RecordCount>
  <cfif FindNoCase("<img", feeditems.content)>
      <cfset images = 1>
    <cfelse>
      <cfset images = 0>
   </cfif>
 <cfquery name="qStoryinsert" datasource="daily-news">
  insert into story
 (catid,title,posted,pubdate,content,rsslink,images)
  VALUES
 (#CatInfo.catid#,'#trim(feeditems.title)#', #NOW()#, '#gmtDate#', '#feeditems.content#','#feeditems.rsslink#', #images#)
 </cfquery>
 </cfif>
 
<!--- Get the saved stories  based on the category id (pk) --->
  <cfquery name="ShowStory" datasource="daily-news">
   select *
   from story
   where catid = #catid#
   order by id desc
  </cfquery>
 
<!--- Simplified output --->
<cfoutput query="ShowStory">
 #title#<br>
 #content#<br>
</cfoutput>
 
Related Solutions
Keywords: Get image path from RSS feed and sav…
 
Loading Advertisement...
 
[+][-]08/30/09 02:00 PM, ID: 25219329Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/30/09 04:04 PM, ID: 25219779Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/30/09 10:51 PM, ID: 25220713Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/31/09 02:19 AM, ID: 25221407Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/31/09 02:50 AM, ID: 25221537Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/31/09 09:44 AM, ID: 25224244Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: ColdFusion Application Server, Cold Fusion Markup Language
Sign Up Now!
Solution Provided By: Qsorb
Participating Experts: 1
Solution Grade: A
 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625