심심해서 재미있으라고 만들어보는 YahooGallery
글쓴이: atie / 작성시간: 일, 2005/07/10 - 2:14오전
:lol:
HtmlParser 1.5를 사용했습니다.
package pe.atie.yg; import java.io.BufferedWriter; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import org.htmlparser.NodeFilter; import org.htmlparser.Parser; import org.htmlparser.filters.AndFilter; import org.htmlparser.filters.HasChildFilter; import org.htmlparser.filters.TagNameFilter; import org.htmlparser.util.NodeList; import org.htmlparser.util.ParserException; public class YahooGallery { private static final int howMany = 19; //20 Pages = 400 Pics private static StringBuffer sb = new StringBuffer(); private static String jjhUrl = "http://images.search.yahoo.com/search/images?ei=UTF-8&fr=sfp&p=%EC%A0%84%EC%A7%80%ED%98%84"; private static Parser parser = new Parser(); private static NodeList list = new NodeList (); private static NodeFilter filter = new AndFilter(new TagNameFilter ("td"), new HasChildFilter (new TagNameFilter ("a"))); private static void makeHtmlHeader() { sb.append("<html>\n"); sb.append("<meta http-equiv='content-type' content='text/html; charset=UTF-8'>\n"); sb.append("<title>Yahoo Gallery</title>\n"); sb.append("<body>\n"); } private static void makeHtmlTitle() { sb.append("<h4>"); sb.append(jjhUrl); sb.append("</h4>\n"); } private static void makeHtmlFooter() { sb.append("</body>\n"); sb.append("</html>"); } private static void convertImageUrl2Html() throws ParserException { list = parser.extractAllNodesThatMatch(filter); //System.out.println(list.toHtml()); sb.append("<table>"); sb.append(list.toHtml()); sb.append("'</table>\n"); } private static void writeHtmlFile() throws IOException { BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("JJHDemo.html"), "UTF8")); writer.write(sb.toString()); writer.close(); } public static void main(String[] args) { try { makeHtmlHeader(); for (int i=0; i<=howMany; i++) { String url = jjhUrl + "&imgsz=all&xargs=0&pstart=1&fr=sfp&b=" + Integer.toString(i*20+1); System.out.println(url); parser.setURL(url); makeHtmlTitle(); convertImageUrl2Html(); } makeHtmlFooter(); writeHtmlFile(); } catch (Exception e) { System.out.println(e); } } }
File attachments:
첨부 | 파일 크기 |
---|---|
![]() | 212.11 KB |
![]() | 92.94 KB |
![]() | 226 KB |
![]() | 216.93 KB |
Forums:
ㅎ 흐 ㅎ ...UI 만들고 있습니다. (아래에 맛보기 화면)swt이
ㅎ 흐 ㅎ ...UI 만들고 있습니다. (아래에 맛보기 화면)
swt이 리눅스에서는 mozilla를 끌어들일 수 있어서 yahoo에서 이미지 링크만 파싱해서 만들고, html 렌더링은 mozilla가 하는 방법으로 GUI하나 해보고 있습니다.
정작 코딩하는 시간보다 레이아웃하고 아이콘 갖다 넣고 하는게 시간이 더 드는군요.
----
I paint objects as I think them, not as I see them.
atie's minipage
SWT 도 applet 처럼 IE,firefox 등에서 사용가능한가요?
SWT 도 applet 처럼 IE,firefox 등에서 사용가능한가요?
python으로 해본 엄지그림 슬라이드쇼
python으로는 처음 코딩을 해 보는거라 구글링해가며 짜집기 해 본 것인데, 커넥션이 리셋되면 대책이 없는 버전이기는 해도 그럭저럭 엄지그림을 슬라이드 쇼 해주기는 합니다. 재미로 보시고 개선 사항을 리플해 주세요.
----
I paint objects as I think them, not as I see them.
atie's minipage
istanbul을 설치해서 더 재미가 있어졌습니다. eclipse에서 p
istanbul을 설치해서 더 재미가 있어졌습니다. eclipse에서 pydev으로 위의 python 코드를 작성하고 실행해 본 5초가 안되는 ogg (동영상) 파일입니다.
----
I paint objects as I think them, not as I see them.
atie's minipage
[quote="atie"]istanbul을 설치해서 더 재미가 있어졌습니
현재 리눅스 파폭(in RH9.0)에서 플러그인이 없다고 하네요.
뭘 설치해야 볼 수 있나요?
[quote="thisrule"][quote="atie"]istanbul
mplayer은 1.0pre7이상이 되어야 자체 디코더로 play가 되고, totem이 설치되어 있으면 링크를 복사해서 보실 수가 있을 겁니다.
----
I paint objects as I think them, not as I see them.
atie's minipage
정정합니다. mplayer에서는 "Ogg stream 0 is of an
정정합니다. mplayer에서는 "Ogg stream 0 is of an unknown type" 이 에러가 나서 play를 할 수 없고, totem-xine이나 vlc로는 볼 수가 있군요. zip 파일을 첨부해 놓습니다.
----
I paint objects as I think them, not as I see them.
atie's minipage
이스탄불에서 생성되는 ogg 파일이 이상해서인지 우분투 브리지가 이상해서
이스탄불에서 생성되는 ogg 파일이 이상해서인지 우분투 브리지가 이상해서인지 xine 계열 플레이어가 GStreamer을 쓰는 경우에만 정상적으로 play가 되는군요.
참고로, 위의 ogg 파일 링크는 http://bbs.kldp.org/files/ythumbs-istanbul_213.ogg 입니다.
----
I paint objects as I think them, not as I see them.
atie's minipage
댓글 달기