hoony's web study

728x90
반응형


HTTP Service를 이용하여 RSS Reader를 한번 구현해보았다.
많은 예제들이 있으나 이런 간단한 예제들이 제일 좋을 것같아서 정리하는
차원에서 한번 만들어보았다.

현재 제 블로그의 RSS를 읽어보니 다음과 같았다.
물론 RSS 2.0 표준형식은 공통으로 다 동일하다고 생각되지만 ..
xml의 구조를 먼저 보여주고 소스를 공개할려고 한다.
이 소스 역시 플렉스 도움말에 있던것을 이용한것이다.
<?xml version="1.0" encoding="UTF-8" ?>

- <rss version="2.0">
- <channel>
  <title>hoony's web study</title>
  <link>http://islet4you.tistory.com/</link>
  <description>웹과 관련된 기술을 공유하는 사이트입니다</description>
  <language>ko</language>
  <pubDate>Fri, 10 Aug 2007 11:15:32 +0900</pubDate>
  <generator>Tistory 1.1</generator>
- <item>
  <title>URLRequest object를 가지고 자바스크립트 실행시키기</title>
  <link>http://islet4you.tistory.com/20</link>
  <description>URLRequest를 이용해서 웹개발을 할때처럼 자바스크립트를 실행시킬 방법이 없을까해서 찾아봤음. 사용법은 무지 간단해 보이더군요. ㅋ 역시 모르면 힘들지만 알면 정말 간단한것 같습니다. ^^ <?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> import flash.net.*; public function callWrapper(e:E..<p><strong><a href="http://islet4you.tistory.com/20">글 전체보기</a></strong></p></description>
  <category>flex</category>
  <category>flex</category>
  <category>javascript & flex</category>
  <category>JavaScript 팁</category>
  <author>후니의 세상</author>
  <guid>http://islet4you.tistory.com/20</guid>
  <comments>http://islet4you.tistory.com/20#entry20comment</comments>
  <pubDate>Thu, 9 Aug 2007 16:43:47 +0900</pubDate>
  </item>
- <item>
  <title>The navigateToURL() method syntax</title>
  <link>http://islet4you.tistory.com/19</link>
  <description>navitageToURL()은 flash.net 패키지 내에 있는 메소드이다. 기본적인 사용법을 보면 navigateToURL(request:URLRequest, window:String):void Value Description _self Specifies the current frame in the current window. _blank Specifies a new window. This new window acts as a pop-up win..<p><strong><a href="http://islet4you.tistory.com/19">글 전체보기</a></strong></p></description>
  <category>flex</category>
  <category>flex</category>
  <category>navigateToURL</category>
  <category>플렉스</category>
  <author>후니의 세상</author>
  <guid>http://islet4you.tistory.com/19</guid>
  <comments>http://islet4you.tistory.com/19#entry19comment</comments>
  <pubDate>Thu, 9 Aug 2007 16:12:43 +0900</pubDate>
  </item>
- <item>
  <title>Using an item renderer with the TileList and HorizontalList controls</title>
  <link>http://islet4you.tistory.com/18</link>
  <description>플래시 개발자가 아닌 개발자가 flex를 접할때 어려움이 바로 이런것이 아닐까 싶어서 예제파일을 던져본다. 이미지를 동적으로 넣고 아울러 item rednerer를 사용하는 좋은 예제인듯하다 플랙스의 Bindable 속성을 이해하는것이 참 힘이 들지만 이 예제를 조금만 바꾼다면 xml 연동 갤러리의 구현도 쉬울것 같아서 올려본다 . <?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe...<p><strong><a href="http://islet4you.tistory.com/18">글 전체보기</a></strong></p></description>
  <category>flex</category>
  <category>flex</category>
  <category>ItemRenderer</category>
  <category>Tilelist</category>
  <category>플렉스</category>
  <author>후니의 세상</author>
  <guid>http://islet4you.tistory.com/18</guid>
  <comments>http://islet4you.tistory.com/18#entry18comment</comments>
  <pubDate>Thu, 9 Aug 2007 16:02:48 +0900</pubDate>
  </item>
- <item>
  <title>flex에서 Using the htmlText property 사용하기</title>
  <link>http://islet4you.tistory.com/17</link>
  <description>역시나 flex에서 html 형식으로 받은 데이터를 어떻게 뿌려줄지 고민이 되다가 help파일을 검색해 보니 이런 내용이 있었다. <?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="450" backgroundGradientColors="[#FFFFFF, #FFFFFF]"> <mx:Text width="100%" color="blue" fontSt..<p><strong><a href="http://islet4you.tistory.com/17">글 전체보기</a></strong></p></description>
  <category>flex</category>
  <category>flex</category>
  <category>HTML</category>
  <author>후니의 세상</author>
  <guid>http://islet4you.tistory.com/17</guid>
  <comments>http://islet4you.tistory.com/17#entry17comment</comments>
  <pubDate>Wed, 8 Aug 2007 11:22:57 +0900</pubDate>
  </item>
- <item>
  <title>flex에서 Data formatting(데이터 포맷 지정하기)</title>
  <link>http://islet4you.tistory.com/16</link>
  <description>어제 하루 영업하느라 쫓아다니느라 내용정리를 못 했네요 ^^ 오늘은 그래두 포스트 하나라두 글 쓸려구 잠시 짬내어서 들어왔어요 ㅋ 보통 개발을 하다보면 C/S 예전의 VB에서 보면 mask editor의 경우 형식을 지정하면서 사용자의 입력양식을 지정 할 수 있었습니다. 근데 Flex에서는 이런 기능이 없을까해서 찾아보니 역시나 언어는 다 똑같은지 하는 방식이 있더군요 ㅋㅋ 너무 간단한 방식 하지만 좀 손이 가기는 가네요 C/S를 예전에 했던 저로서..<p><strong><a href="http://islet4you.tistory.com/16">글 전체보기</a></strong></p></description>
  <category>flex</category>
  <category>DataFormat</category>
  <category>flex</category>
  <author>후니의 세상</author>
  <guid>http://islet4you.tistory.com/16</guid>
  <comments>http://islet4you.tistory.com/16#entry16comment</comments>
  <pubDate>Wed, 8 Aug 2007 10:39:40 +0900</pubDate>
  </item>
- <item>
  <title>플렉스(Flex)에서 팝업창을 만드는 방법</title>
  <link>http://islet4you.tistory.com/15</link>
  <description>플렉스로 요즘 개발준비를 하면서 팝업창을 만드는 방법을 찾다가 답을 찾아서 이렇게 글을 올리게 되었다. 물론 내가 쓰는 글은 우리 팀원들을 위해서 하구 있지만 ㅋㅋ 팝업윈도우를 만들기 위해서는 아래와 같은 속성을 써야한다. To create a pop-up window, use the PopUpManager's createPopUp() method. The createPopUp() method has the following signature: pu..<p><strong><a href="http://islet4you.tistory.com/15">글 전체보기</a></strong></p></description>
  <category>flex</category>
  <category>FLEX2.0</category>
  <author>후니의 세상</author>
  <guid>http://islet4you.tistory.com/15</guid>
  <comments>http://islet4you.tistory.com/15#entry15comment</comments>
  <pubDate>Mon, 6 Aug 2007 17:23:37 +0900</pubDate>
  </item>
- <item>
  <title>flex에서 swf나 mxml에 파라미터를 던지는 방법(Using query string parameters)</title>
  <link>http://islet4you.tistory.com/14</link>
  <description>Using query string parameter를 사용해서 flex 내부 및 swf 에 파라미터를 던지는 방법 http://localhost:8101/flex/charts/PieChart1.mxml?fname=Nick&lname=Danger <object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/..<p><strong><a href="http://islet4you.tistory.com/14">글 전체보기</a></strong></p></description>
  <category>flex</category>
  <category>queryString</category>
  <category>파라미터처리</category>
  <category>플렉스2</category>
  <author>후니의 세상</author>
  <guid>http://islet4you.tistory.com/14</guid>
  <comments>http://islet4you.tistory.com/14#entry14comment</comments>
  <pubDate>Mon, 6 Aug 2007 12:16:48 +0900</pubDate>
  </item>
- <item>
  <title>입력내용 글자수 세기</title>
  <link>http://islet4you.tistory.com/13</link>
  <description><form name='form'> <textarea name="content" cols="20" rows="7" style="overflow:auto;border:0px;width:160px;font-size:9pt;background-color:E5F1FB;" onKeydown="javascript:getLength(content.value)" onKeyUp="javascript:getLength(content.value)"></textarea>..<p><strong><a href="http://islet4you.tistory.com/13">글 전체보기</a></strong></p></description>
  <category>asp</category>
  <category>JavaScript 팁..</category>
  <author>후니의 세상</author>
  <guid>http://islet4you.tistory.com/13</guid>
  <comments>http://islet4you.tistory.com/13#entry13comment</comments>
  <pubDate>Sat, 4 Aug 2007 23:03:58 +0900</pubDate>
  </item>
- <item>
  <title>이미지 및 프린터 버튼 못하게 하는 태그</title>
  <link>http://islet4you.tistory.com/12</link>
  <description><meta http-equiv="imagetoolbar" content="no"> 웹이미지에 프린터 및 저장 버튼 뜨지 못하게 하는 태그라는데.. 검색어를 입력하십시오. 검색양식 제출 Web islet4you.tistory.com<p><strong><a href="http://islet4you.tistory.com/12">글 전체보기</a></strong></p></description>
  <category>asp</category>
  <author>후니의 세상</author>
  <guid>http://islet4you.tistory.com/12</guid>
  <comments>http://islet4you.tistory.com/12#entry12comment</comments>
  <pubDate>Sat, 4 Aug 2007 22:16:22 +0900</pubDate>
  </item>
- <item>
  <title>Compile mxml in Apache/IIS</title>
  <link>http://islet4you.tistory.com/11</link>
  <description>Compile mxml in Apache/IIS The Flex module for Apache and Microsoft IIS provides web-tier compilation of MXML and ActionScript files on Apache and IIS web servers. This module lets you rapidly compile, test and deploy an application by simply requesting..<p><strong><a href="http://islet4you.tistory.com/11">글 전체보기</a></strong></p></description>
  <category>flex</category>
  <author>후니의 세상</author>
  <guid>http://islet4you.tistory.com/11</guid>
  <comments>http://islet4you.tistory.com/11#entry11comment</comments>
  <pubDate>Sat, 4 Aug 2007 20:58:11 +0900</pubDate>
  </item>
  </channel>
  </rss>

위는 xml 소스이며
다음은 소스 부분이다
너무나 간단해서 설명보다는 예제를 보신다면 아실것 같다.
^^
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
    creationComplete="feedRequest.send()" >
    <mx:HTTPService
        id="feedRequest"
        url="http://islet4you.tistory.com/rss"
        useProxy="false" />
    <mx:Panel x="10" y="10" width="475" height="400" layout="absolute"
        title="{feedRequest.lastResult.rss.channel.title}">
        <mx:DataGrid x="20" y="20" id="dgPosts" width="400" dataProvider="{feedRequest.lastResult.rss.channel.item}">
            <mx:columns>
                <mx:DataGridColumn headerText="제목" dataField="title"/>
                <mx:DataGridColumn headerText="발행날짜" dataField="pubDate" width="150"/>
            </mx:columns>
        </mx:DataGrid>
        <mx:LinkButton x="20" y="311" label="전체글보러가기" click="navigateToURL(new URLRequest(dgPosts.selectedItem.link));" />
        <mx:TextArea x="20" y="175" width="400"  htmlText="{dgPosts.selectedItem.description}"  height="128"/>
    </mx:Panel>
   
</mx:Application>

구동되는 예제는 아래와 같으며 자신의 rss 주소만 바꿔서 컴파일하면
자신만의 RSS 리더기가 완성됩니다. ^^

728x90

공유하기

facebook twitter kakaoTalk kakaostory naver band
loading