JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 25
  • Score
    100M100P100Q58540F
  • License MIT

GitHub style blog activity visualization widget with RSS feed support, local proxy server integration, and enhanced customization options

Package Exports

  • blog-garden-widget
  • blog-garden-widget/blog-garden-widget.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (blog-garden-widget) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

๐ŸŽฏ Graden Widget

GitHub ์Šคํƒ€์ผ์˜ ํ‹ฐ์Šคํ† ๋ฆฌ ๋ธ”๋กœ๊ทธ ํ™œ๋™ ๊ธฐ๋ก ์‹œ๊ฐํ™” ์œ„์ ฏ์ž…๋‹ˆ๋‹ค. RSS ํ”ผ๋“œ๋ฅผ ์ž๋™์œผ๋กœ ํŒŒ์‹ฑํ•˜์—ฌ ์ตœ๊ทผ 1๋…„๊ฐ„์˜ ๋ธ”๋กœ๊ทธ ํ™œ๋™์„ GitHub ์ž”๋””์™€ ๋™์ผํ•œ ์Šคํƒ€์ผ๋กœ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

โœจ ์ฃผ์š” ๊ธฐ๋Šฅ

  • ๐ŸŽจ GitHub ์Šคํƒ€์ผ: ์ •ํ™•ํ•œ GitHub ์ž”๋”” ์ƒ‰์ƒ ์ฝ”๋“œ ์‚ฌ์šฉ
  • ๐Ÿ“ก RSS ์ž๋™ ํŒŒ์‹ฑ: RSS ํ”ผ๋“œ์—์„œ ๊ฒŒ์‹œ๋ฌผ ์ •๋ณด ์ž๋™ ์ˆ˜์ง‘
  • ๐Ÿ”„ ์ž๋™ ์—…๋ฐ์ดํŠธ: 24์‹œ๊ฐ„๋งˆ๋‹ค ๋ฐ์ดํ„ฐ ์ž๋™ ๊ฐฑ์‹ 
  • ๐Ÿ“ฑ ๋ฐ˜์‘ํ˜• ๋””์ž์ธ: ๋ชจ๋ฐ”์ผ๊ณผ ๋ฐ์Šคํฌํ†ฑ ๋ชจ๋‘ ์ง€์›
  • ๐ŸŒ ํ•œ๊ตญ์–ด ์ง€์›: ํ•œ๊ตญ์–ด ๋‚ ์งœ ํ˜•์‹๊ณผ ๋ฉ”์‹œ์ง€
  • โš™๏ธ ์™„์ „ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•: ์ œ๋ชฉ, ์ƒ‰์ƒ, ์—…๋ฐ์ดํŠธ ์ฃผ๊ธฐ ๋“ฑ ์„ค์ • ๊ฐ€๋Šฅ
  • ๐Ÿงน ๋ฉ”๋ชจ๋ฆฌ ๊ด€๋ฆฌ: destroy() ๋ฉ”์„œ๋“œ๋กœ ๋ฆฌ์†Œ์Šค ์ •๋ฆฌ
  • ๐Ÿš€ ๋กœ์ปฌ ํ”„๋ก์‹œ ์„œ๋ฒ„: CORS ๋ฌธ์ œ ํ•ด๊ฒฐ์„ ์œ„ํ•œ ๋กœ์ปฌ ํ”„๋ก์‹œ ์„œ๋ฒ„ ์ œ๊ณต

๐Ÿš€ ๋น ๋ฅธ ์‹œ์ž‘

1. ์Šคํฌ๋ฆฝํŠธ ๋กœ๋“œ

<script src="https://unpkg.com/blog-garden-widget@latest/blog-garden-widget.js"></script>

2. HTML ์ปจํ…Œ์ด๋„ˆ ์ƒ์„ฑ

<div id="my-tistory-blog-garden-widget"></div>

3. ์œ„์ ฏ ์ดˆ๊ธฐํ™”

const widget = new GradenWidget('#my-tistory-blog-garden-widget', {
    rssUrl: 'https://pearlluck.tistory.com/rss',
    title: '๋‚ด ๋ธ”๋กœ๊ทธ ํ™œ๋™'
});

๐Ÿ”ง ํ”„๋ก์‹œ ์„œ๋ฒ„ ์„ค์ • (v1.1.0)

CORS ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ๋กœ์ปฌ ํ”„๋ก์‹œ ์„œ๋ฒ„๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

ํ”„๋ก์‹œ ์„œ๋ฒ„ ์‹คํ–‰

# ์˜์กด์„ฑ ์„ค์น˜
npm install cors express node-fetch xml2js

# ํ”„๋ก์‹œ ์„œ๋ฒ„ ์‹คํ–‰
node proxy-server.js

ํ”„๋ก์‹œ ์„œ๋ฒ„ ์—”๋“œํฌ์ธํŠธ

  • RSS ๋ถ„์„: http://localhost:3001/analyze/rss?url=RSS_URL
  • ์›๋ณธ RSS: http://localhost:3001/proxy/rss?url=RSS_URL
  • ํ—ฌ์Šค์ฒดํฌ: http://localhost:3001/health

ํ”„๋ก์‹œ ์„œ๋ฒ„ ๊ธฐ๋Šฅ

  • RSS ํ”ผ๋“œ ์ž๋™ ํŒŒ์‹ฑ
  • ๋‚ ์งœ๋ณ„ ๊ฒŒ์‹œ๋ฌผ ์ˆ˜ ๊ณ„์‚ฐ
  • CORS ๋ฌธ์ œ ํ•ด๊ฒฐ
  • ๋‹ค์–‘ํ•œ RSS ํ˜•์‹ ์ง€์› (RSS, Atom)

๐Ÿ“– ์‚ฌ์šฉ๋ฒ•

๊ธฐ๋ณธ ์‚ฌ์šฉ๋ฒ•

// ๊ฐ€์žฅ ๊ฐ„๋‹จํ•œ ์‚ฌ์šฉ๋ฒ•
const widget = new GradenWidget('#container');

// RSS URL๊ณผ ์ œ๋ชฉ ์„ค์ •
const widget = new GradenWidget('#container', {
    rssUrl: 'https://pearlluck.tistory.com/rss',
    title: '๋‚ด ๋ธ”๋กœ๊ทธ ํ™œ๋™'
});

๊ณ ๊ธ‰ ์„ค์ •

const widget = new GradenWidget('#container', {
    rssUrl: 'https://pearlluck.tistory.com/rss',
    title: '๊ณ ๊ธ‰ ์„ค์ • ์œ„์ ฏ',
    updateInterval: 12 * 60 * 60 * 1000, // 12์‹œ๊ฐ„๋งˆ๋‹ค ์—…๋ฐ์ดํŠธ
    showLegend: true,
    showFooter: true,
    colors: {
        0: '#ebedef',  // ํ™œ๋™ ์—†์Œ
        1: '#9be9a8',  // ๋‚ฎ์€ ํ™œ๋™
        2: '#40c463',  // ์ค‘๊ฐ„ ํ™œ๋™
        3: '#30a14e',  // ๋†’์€ ํ™œ๋™
        4: '#216e39'   // ์ตœ๊ณ  ํ™œ๋™
    }
});

HTML ์†์„ฑ์œผ๋กœ ์ž๋™ ์ดˆ๊ธฐํ™”

<div data-graden-widget
     data-rss-url="https://pearlluck.tistory.com/rss"
     data-title="์ž๋™ ์ดˆ๊ธฐํ™” ์œ„์ ฏ"
     data-update-interval="86400000"
     data-show-legend="true"
     data-show-footer="true">
</div>

โš™๏ธ ์„ค์ • ์˜ต์…˜

์˜ต์…˜ ํƒ€์ž… ๊ธฐ๋ณธ๊ฐ’ ์„ค๋ช…
rssUrl string 'https://pearlluck.tistory.com/rss' RSS ํ”ผ๋“œ URL
title string 'ํ™œ๋™ ๊ธฐ๋ก' ์œ„์ ฏ ์ œ๋ชฉ
updateInterval number 86400000 ์—…๋ฐ์ดํŠธ ์ฃผ๊ธฐ (๋ฐ€๋ฆฌ์ดˆ, 24์‹œ๊ฐ„)
showLegend boolean true ๋ฒ”๋ก€ ํ‘œ์‹œ ์—ฌ๋ถ€
showFooter boolean true ํ‘ธํ„ฐ ํ‘œ์‹œ ์—ฌ๋ถ€
colors object GitHub ์Šคํƒ€์ผ ์ƒ‰์ƒ ์ƒ‰์ƒ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•

๐Ÿ”ง API ๋ฉ”์„œ๋“œ

update()

์ˆ˜๋™์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์—…๋ฐ์ดํŠธํ•ฉ๋‹ˆ๋‹ค.

widget.update().then(() => {
    console.log('๋ฐ์ดํ„ฐ ์—…๋ฐ์ดํŠธ ์™„๋ฃŒ');
});

destroy()

์œ„์ ฏ์„ ์ œ๊ฑฐํ•˜๊ณ  ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ์ •๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

widget.destroy();

setOptions(newOptions)

์œ„์ ฏ ์˜ต์…˜์„ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.

widget.setOptions({
    title: '์ƒˆ๋กœ์šด ์ œ๋ชฉ',
    showLegend: false
});

๐ŸŒ npm ํŒจํ‚ค์ง€ ๋ฐฐํฌ

unpkg (npm ํŒจํ‚ค์ง€ ๋ฐฐํฌ ํ›„)

npm login  # npm ๋กœ๊ทธ์ธ
npm publish --dry-run  # ํผ๋ธ”๋ฆฌ์‹œ ์ „ ๊ฒ€์ฆ
npm pack  # ํŒจํ‚ค์ง€์— ํฌํ•จ๋  ํŒŒ์ผ ํ™•์ธ
npm publish  # ๋ฐฐํฌ

๐ŸŒ CDN ๋ฐฐํฌ

unpkg (์ตœ์‹  ๋ฒ„์ „ ์ž๋™ ์ถ”์ )

<script src="https://unpkg.com/blog-garden-widget@latest/blog-garden-widget.js"></script>

unpkg ๊ถŒ์žฅ๋ฐฉ์‹ (ํŠน์ • ๋ฒ„์ „ ๊ณ ์ •)

<script src="https://unpkg.com/blog-garden-widget@1.1.0/blog-garden-widget.js"></script>

๐Ÿ“ฑ ํ‹ฐ์Šคํ† ๋ฆฌ ๋ธ”๋กœ๊ทธ์— ์‚ฝ์ž…

HTML ํŽธ์ง‘๊ธฐ ์‚ฌ์šฉ

  1. ํ‹ฐ์Šคํ† ๋ฆฌ ๊ด€๋ฆฌ์ž ํŽ˜์ด์ง€ โ†’ ๊พธ๋ฏธ๊ธฐ โ†’ HTML ํŽธ์ง‘
  2. ์›ํ•˜๋Š” ์œ„์น˜์— ์œ„์ ฏ ์ฝ”๋“œ ์‚ฝ์ž…
  3. ์ €์žฅ ํ›„ ๋ธ”๋กœ๊ทธ ํ™•์ธ

์‚ฌ์ด๋“œ๋ฐ” ์œ„์ ฏ์œผ๋กœ ์ถ”๊ฐ€

  1. ํ‹ฐ์Šคํ† ๋ฆฌ ๊ด€๋ฆฌ์ž ํŽ˜์ด์ง€ โ†’ ๊พธ๋ฏธ๊ธฐ โ†’ ์‚ฌ์ด๋“œ๋ฐ”
  2. HTML ์œ„์ ฏ ์ถ”๊ฐ€
  3. ์œ„์ ฏ ์ฝ”๋“œ ์‚ฝ์ž…

๐ŸŽจ ์ƒ‰์ƒ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•

๊ธฐ๋ณธ GitHub ์Šคํƒ€์ผ ์ƒ‰์ƒ:

colors: {
    0: '#ebedef',  // ํ™œ๋™ ์—†์Œ (ํšŒ์ƒ‰)
    1: '#9be9a8',  // ๋‚ฎ์€ ํ™œ๋™ (์—ฐํ•œ ์ดˆ๋ก)
    2: '#40c463',  // ์ค‘๊ฐ„ ํ™œ๋™ (์ค‘๊ฐ„ ์ดˆ๋ก)
    3: '#30a14e',  // ๋†’์€ ํ™œ๋™ (์ง„ํ•œ ์ดˆ๋ก)
    4: '#216e39'   // ์ตœ๊ณ  ํ™œ๋™ (๊ฐ€์žฅ ์ง„ํ•œ ์ดˆ๋ก)
}

๐Ÿ” ๋ธŒ๋ผ์šฐ์ € ์ง€์›

  • Chrome 60+
  • Firefox 55+
  • Safari 12+
  • Edge 79+

๐Ÿ“ˆ ๋ฒ„์ „ ํžˆ์Šคํ† ๋ฆฌ

v1.1.0

  • ๐Ÿš€ ๋กœ์ปฌ ํ”„๋ก์‹œ ์„œ๋ฒ„ ์ถ”๊ฐ€: CORS ๋ฌธ์ œ ํ•ด๊ฒฐ์„ ์œ„ํ•œ ํ”„๋ก์‹œ ์„œ๋ฒ„ ์ œ๊ณต
  • ๐Ÿ“Š RSS ๋ถ„์„ ์—”๋“œํฌ์ธํŠธ: ๋‚ ์งœ๋ณ„ ๊ฒŒ์‹œ๋ฌผ ์ˆ˜ ์ž๋™ ๊ณ„์‚ฐ
  • ๐Ÿ”ง ์„ฑ๋Šฅ ์ตœ์ ํ™”: ์„œ๋ฒ„ ์‚ฌ์ด๋“œ RSS ํŒŒ์‹ฑ์œผ๋กœ ํด๋ผ์ด์–ธํŠธ ๋ถ€๋‹ด ๊ฐ์†Œ
  • ๐ŸŒ ๋‹ค์–‘ํ•œ RSS ํ˜•์‹ ์ง€์›: RSS, Atom ํ”ผ๋“œ ๋ชจ๋‘ ์ง€์›
  • ๐Ÿ“ ํ”„๋ก์‹œ ์„œ๋ฒ„ ๋ฌธ์„œํ™”: ์ƒ์„ธํ•œ ์„ค์ • ๋ฐ ์‚ฌ์šฉ๋ฒ• ์ œ๊ณต

v1.0.0

  • ์ดˆ๊ธฐ ๋ฆด๋ฆฌ์Šค
  • GitHub ์Šคํƒ€์ผ ํ™œ๋™ ๊ธฐ๋ก ์œ„์ ฏ
  • RSS ํ”ผ๋“œ ์ž๋™ ํŒŒ์‹ฑ
  • 24์‹œ๊ฐ„ ์ž๋™ ์—…๋ฐ์ดํŠธ
  • ์™„์ „ํ•œ ์ปค์Šคํ„ฐ๋งˆ์ด์ง• ์˜ต์…˜