npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

iranian-news-agencies-crawler

v1.0.5

Published

A crawler to fetch last news from Iranian(Persian) news agencies.

Downloads

19

Readme

iranian-news-agencies-crawler

a crawler to fetch last news from Iranian(Persian) news agencies.

دریافت اخرین اخبار خبرگزاری های ایران

این کتابخانه ماانند یک API برای دریافت اخرین اخبار از خبرگزاری های مهم فارسی زبان داخلی و خارجی است به زبان node.js که خبرگزاری های زیر را پشتیبانی می‌کند:

| نام خبرگزاری | کلید | لوگو | | --- | --- | --- | | خبرگزاری فارس | fars | | | خبرگزاری ایرنا | irna | | | باشگاه خبرنگاران جوان | yjc | | | خبرگزاری ایسنا | isna | | | خبرگزاری تسنیم | tasnim | | | بی بی سی | bbc | | | خبرگزاری مهر | mehr | | | خبرگزاری ایلنا | ilna | | | خبرگزاری موج | moj | | | خبرگزاری تابناک | tabnak | | | خبرآنلاین | khabaronline | | | خبرگزاری برنا | borna | | | خبرگزاری آنا | ana | | | الف | alef | | | خبرگزاری صداسیما | irib | | | خبرگزاری sputnik | sputnik | | | خبرگزاری independent | independent | | | VOA فارسی | voa | |

نصب

npm i iranian-news-agencies-crawler

نحوه استفاده

const fetchNews = require('iranian-news-agencies-crawler');
...
// دریافت عنواوین خبر بدون متن اصلی 
// تاخیر زیر ۱ ثانیه
var lastNews = await fetchNews('isna', { includeNewsText: false });
...

// دریافت عنواوین خبر به همراه متن اصلی 
// تاخیر بسته به نوع خبرگزاری و سرعت اینترنت سرور بین ۲ تا ۶ ثانیه
var lastNews = await fetchNews('fars', { includeNewsText: true });
...
...
...
/* خروجی :
 lastNews = [
 {
  title:'عنوان خبر',
  text:'عنوان خبر',
  img:'عکس خبر در صورت پیدا شدن',
  keywords: [ارایه ای از کلمات کلیدی پیدا شده از خبر],
  categories: [ آرایه ای از دسته بندی های پیدا شده از خبر],
  date:'Thu, 24 Mar 2022 10:26:50 GMT'
  id:'https://farsnews.ir/xxxxx'
  link:'https://farsnews.ir/xxxxx'
 }
...
]
*/
  • پارامتر اول نام خبرگزاری است که در جدول بالا و در ستون کلید هر خبرگزاری درج شده است.
  • بدیهی است که برای دریافت خبر های خبرگزاری های خارج از ایران مثل بی بی سی VOA و independent باید سرور خارج از کشور باشد و در محیط لوکال VPN متصل باشد.
  • با توجه با تاخیر ذکر شده توصیه میشود این کد به صورت یک task با بازه زمانی مشخص اجرا شود.

این کتاب خونه بسیار سادست و خودتون هم می‌تونید توسعش بدید ولی با این حال خوشحال می‌شم نظرو یا باگ های احتمالیش رو همینجا از طریق 'گیت هاب' و یا توییتر بهم بگید. 😊😊