AI[ rssํ”ผ๋“œ][๋‰ด์Šคํฌ๋กค๋Ÿฌ][API ์ƒํƒœ์ ๊ฒ€] [๋ฐ์ดํ„ฐ๊ฒ€์ฆ ์‹œ์Šคํ…œ]

AI ์ •๋ณด ์‹ค์‹œ๊ฐ„ ์—…๋ฐ์ดํŠธ ์‹œ์Šคํ…œ

1. RSS ํ”ผ๋“œ ๋ชจ๋‹ˆํ„ฐ๋ง ์‹œ์Šคํ…œ

์ฃผ์š” AI ๊ด€๋ จ RSS ํ”ผ๋“œ๋ฅผ ์‹ค์‹œ๊ฐ„์œผ๋กœ ๋ชจ๋‹ˆํ„ฐ๋งํ•˜๋Š” ์‹œ์Šคํ…œ์ž…๋‹ˆ๋‹ค.


const feedparser = require('feedparser-promised');

async function monitorRSSFeeds() {
    const feeds = [
        'https://blog.google/technology/ai/rss/',
        'https://openai.com/blog/rss/',
        'https://news.mit.edu/rss/topic/artificial-intelligence'
    ];

    try {
        for (const feed of feeds) {
            const items = await feedparser.parse(feed);
            const latestItems = items
                .filter(item => {
                    const pubDate = new Date(item.pubDate);
                    const now = new Date();
                    // 24์‹œ๊ฐ„ ์ด๋‚ด์˜ ๊ธ€๋งŒ ํ•„ํ„ฐ๋ง
                    return (now - pubDate) < 24 * 60 * 60 * 1000;
                })
                .map(item => ({
                    title: item.title,
                    link: item.link,
                    pubDate: item.pubDate,
                    description: item.description
                }));

            // ์ƒˆ๋กœ์šด ๊ธ€ ๋ฐœ๊ฒฌ์‹œ ์ฒ˜๋ฆฌ
            if (latestItems.length > 0) {
                updateBlogPost(latestItems);
            }
        }
    } catch (error) {
        console.error('RSS ํ”ผ๋“œ ๋ชจ๋‹ˆํ„ฐ๋ง ์ค‘ ์˜ค๋ฅ˜:', error);
    }
}

// 6์‹œ๊ฐ„๋งˆ๋‹ค ์‹คํ–‰
setInterval(monitorRSSFeeds, 6 * 60 * 60 * 1000);
        

2. AI ๋‰ด์Šค ํฌ๋กค๋Ÿฌ

์ฃผ์š” AI ๋‰ด์Šค ์‚ฌ์ดํŠธ์˜ ์ตœ์‹  ์ •๋ณด๋ฅผ ์ˆ˜์ง‘ํ•˜๋Š” ํฌ๋กค๋Ÿฌ์ž…๋‹ˆ๋‹ค.


const axios = require('axios');
const cheerio = require('cheerio');

async function crawlAINews() {
    const sites = [
        {
            url: 'https://venturebeat.com/category/ai/',
            selector: 'article.Article'
        },
        {
            url: 'https://www.artificialintelligence-news.com/',
            selector: '.post-title'
        }
    ];

    for (const site of sites) {
        try {
            const response = await axios.get(site.url);
            const $ = cheerio.load(response.data);
            
            const articles = [];
            $(site.selector).each((i, elem) => {
                const title = $(elem).find('h2').text().trim();
                const link = $(elem).find('a').attr('href');
                if (title && link) {
                    articles.push({ title, link });
                }
            });

            // ์ƒˆ๋กœ์šด ๊ธฐ์‚ฌ ๋ฐœ๊ฒฌ์‹œ ์ฒ˜๋ฆฌ
            if (articles.length > 0) {
                updateBlogPost(articles);
            }
        } catch (error) {
            console.error(`ํฌ๋กค๋ง ์ค‘ ์˜ค๋ฅ˜ (${site.url}):`, error);
        }
    }
}

// 3์‹œ๊ฐ„๋งˆ๋‹ค ์‹คํ–‰
setInterval(crawlAINews, 3 * 60 * 60 * 1000);
        

3. API ์ƒํƒœ ๋ชจ๋‹ˆํ„ฐ๋ง

์ฃผ์š” AI API์˜ ์ƒํƒœ์™€ ์—…๋ฐ์ดํŠธ๋ฅผ ๋ชจ๋‹ˆํ„ฐ๋งํ•ฉ๋‹ˆ๋‹ค.


const { Configuration, OpenAIApi } = require('openai');
const { GoogleAuth } = require('google-auth-library');

async function checkAPIStatus() {
    const apis = [
        {
            name: 'OpenAI',
            checkFunction: async () => {
                const configuration = new Configuration({
                    apiKey: process.env.OPENAI_API_KEY
                });
                const openai = new OpenAIApi(configuration);
                const response = await openai.listModels();
                return response.data;
            }
        },
        {
            name: 'Google AI',
            checkFunction: async () => {
                const auth = new GoogleAuth({
                    keyFilename: 'path/to/service-account.json'
                });
                const client = await auth.getClient();
                const response = await client.request({
                    url: 'https://api.googleapis.com/v1/models'
                });
                return response.data;
            }
        }
    ];

    for (const api of apis) {
        try {
            const status = await api.checkFunction();
            updateBlogPost({
                apiName: api.name,
                status: 'active',
                lastChecked: new Date(),
                details: status
            });
        } catch (error) {
            console.error(`API ์ฒดํฌ ์ค‘ ์˜ค๋ฅ˜ (${api.name}):`, error);
        }
    }
}

// 1์‹œ๊ฐ„๋งˆ๋‹ค ์‹คํ–‰
setInterval(checkAPIStatus, 60 * 60 * 1000);
        

4. ๋ฐ์ดํ„ฐ ๊ฒ€์ฆ ์‹œ์Šคํ…œ

์ˆ˜์ง‘๋œ ์ •๋ณด์˜ ์‹ ๋ขฐ์„ฑ์„ ๊ฒ€์ฆํ•˜๋Š” ์‹œ์Šคํ…œ์ž…๋‹ˆ๋‹ค.


class DataValidator {
    constructor() {
        this.trustedSources = new Set([
            'openai.com',
            'google.com',
            'arxiv.org',
            'microsoft.com',
            'deepmind.com'
        ]);
    }

    validateSource(url) {
        try {
            const domain = new URL(url).hostname;
            return this.trustedSources.has(domain);
        } catch {
            return false;
        }
    }

    validateDate(pubDate) {
        const date = new Date(pubDate);
        const now = new Date();
        // ์ผ์ฃผ์ผ ์ด๋‚ด์˜ ๋ฐ์ดํ„ฐ๋งŒ ์œ ํšจ
        return (now - date) < 7 * 24 * 60 * 60 * 1000;
    }

    async validateContent(content) {
        // ํ‚ค์›Œ๋“œ ๊ธฐ๋ฐ˜ ๊ฒ€์ฆ
        const aiKeywords = ['artificial intelligence', 'machine learning', 'deep learning', 'neural network'];
        return aiKeywords.some(keyword => 
            content.toLowerCase().includes(keyword)
        );
    }

    async validate(data) {
        return {
            isValidSource: this.validateSource(data.url),
            isValidDate: this.validateDate(data.pubDate),
            isValidContent: await this.validateContent(data.content)
        };
    }
}

const validator = new DataValidator();

// ์‚ฌ์šฉ ์˜ˆ์‹œ
async function validateAndUpdate(data) {
    const validation = await validator.validate(data);
    if (validation.isValidSource && 
        validation.isValidDate && 
        validation.isValidContent) {
        updateBlogPost(data);
    }
}
        
================== ์‹ค์ œ๋กœ ๋˜๋ฉด ์–ผ๋งˆ๋‚˜ ์ข‹์„๊นŒ์š” ์ตœ์‹ ์„ฑ๋„ ํ™•๋ณด๊ฐ€ ๋˜๊ณ  ์ œ๊ฐ€๋ณด๊ธฐ์—” ํŒŒ๊ณ ๋“ค์–ด๊ฐ€๋‹ค ๋ณด๋ฉด ๋ถ„๋ช…ํžˆ ๋ง‰ํžˆ๋Š” ๋ถ€๋ถ„์ด๋‚˜ ai๊ฐ€ ์—ฟ๋„ ๋งŽ์ด ๋ฏธ๋ผ๋กœ ๊น”์•„๋†“์„๊ฑฐ ๊ฐ™๋‹ค ๋‚˜๋Š” ํ•ด๋ณด๊ฒ ์ง€๋งŒ ์•„๋งˆ๋„ ๊ทธ๋ ‡๊ฒŒ ์†์‹œ์›ํ•œ ๋‹ต๋ณ€์ด ๋ ๊ฑฐ ๊ฐ™์ง„ ์•ˆ์ง€๋งŒ ๊ทธ๋ž˜๋„ ์ง€ํ‘ธ๋ผ๊ธฐ ๋ผ๋„ ์žก๊ณ  ์‹ถ์œผ์‹  ๋ถ„๋“ค์˜ ์ฐฝ์ฐฝํ•œ ์•ž๋‚ ์„ ๊ธฐ๋Œ€ํ•œ๋‹ค ํŒŒ์ดํŒ… ~~!!!

๋Œ“๊ธ€

์ด ๋ธ”๋กœ๊ทธ์˜ ์ธ๊ธฐ ๊ฒŒ์‹œ๋ฌผ

2025 ์‚ผ์„ฑ ๋ผ์ด์˜จ์ฆˆ ๋ธ”๋ฃจ ๋ฉค๋ฒ„์‹ญ์˜ ๊ฐ€์ž… ๋ฐฉ๋ฒ•, ์„ ์˜ˆ๋งค ํ˜œํƒ, ํšŒ์›๊ถŒ ํŒ๋งค ์ผ์ • ๋ฐ ์˜ˆ์ƒ ๋ณ€๊ฒฝ์‚ฌํ•ญ ์ด์ •๋ฆฌ

2025๋…„ ์ „๊ตญ ์•„ํŒŒํŠธ ๋ถ„์–‘ ์ผ์ • & ์ฒญ์•ฝ ์ „๋žต ์ด์ •๋ฆฌup

2025 ํ•œํ™”์ด๊ธ€์Šค ์‹œ์ฆŒ๊ถŒ๊ณผ ๋ฉค๋ฒ„์‹ญ ๊ตฌ์„ฑ, ๊ฐ€๊ฒฉ, ํ˜œํƒ ๋ฐ ๋ชจ์ง‘ ์ผ์ • ์•ˆ๋‚ด ์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๊ธฐ