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

telegram-scraper

v1.0.1

Published

A simple Telegram channel scraper

Downloads

145

Readme

telegram-scraper

A simple Telegram channel scraper

NPM npm version

Features

  • ✅ 0 Dependencies
  • ✅ No Authentication
  • ✅ JSON Output

Demo

https://codesandbox.io/p/devbox/telegram-channel-scraper-q9g93l

Installation

npm install telegram-scraper

Example Usage

import {telegram_scraper} from 'telegram-scraper'

void async function main() {

	let telegram_channel_username = 'telegram'

	let result = await telegram_scraper(telegram_channel_username)

	console.log(result)
	
}()
const {telegram_scraper} = require('telegram-scraper')

void async function main() {

	let telegram_channel_username = 'telegram'

	let result = await telegram_scraper(telegram_channel_username)

	console.log(result)
	
}()

Example App

const {telegram_scraper} = require('telegram-scraper')

const http = require('http')

const serverport =  process.env.PORT || 8080

let telegram_channel = 'telegram'

const server = http.createServer(async(req,res)=>{

	let result = await telegram_scraper(telegram_channel)

	res.statusCode = 200
	
	res.setHeader('Content-Type','text/plain')
	
	res.setHeader('Access-Control-Allow-Origin','*')
	
	res.end(result)
	
})

server.listen(serverport,()=>{

	console.log(`Server running at ${serverport}`) 
	
})

Example Output

[
          {
                    "data_post": "telegram/273",
                    "data_view": "eyJjIjotMTAwNTY0MDg5MiwicCI6MjczLCJ0IjoxNzA2MDIxNDM4LCJoIjoiZDhmYjYxZTY2YjNkN2U5MDhjIn0",
                    "user_url": "https://t.me/telegram",
                    "user_photo": "https://cdn1.cdn-telegram.org/file/nNL6OPWszs6ukBWYYE29IVkpXLnODwiktlGA2cGdDmgEjIzF69xTlYmr6yudxxf47h8HRovBHDJa5zOIluMkVOLQTg-NePGvpUnSD56QzI49__W_PUXMNR11M4VItBvBiwcC3rJsPAh1yKHCwKnoe-GDswGVCZa9pBH-GzTqQbyp6Lku5ZwS5ASI7S-D6eBqvZeH4baj5PShtSXRaQWsFIHhCX-Driia0jtV8mmtZRcSb7sgtusVXrOl1EOk7mTQrzToiq4Y9YEuMUE2_587fq3G3uFCAh-7jIMpdrU7ZxvDuwdZlS9VZRT-LGvrz3P7YLtTzLt_nOXWARpCS8pJNg.jpg",
                    "user_name": "Telegram News",
                    "message_url": "https://t.me/telegram/273",
                    "message_text": "⭐️ One-Way Last Seen and Read Times. Users who hide their read time aren't able to see read times from other users.  With Telegram Premium, you can hide your read time and still see the read times of users who share theirs with you.  If a user hides their read time, it is always hidden from all users, including Premium users.  January Features 1 • 2 • 3 • 4 • 5",
                    "message_photo": [],
                    "message_video": [
                              "https://cdn1.cdn-telegram.org/file/21caaf78bd.mp4?token=SqjZNcBiqv8ttYltO9lx7cO-t_n7-dhY9zPyCU6TGBo_kO1nfxiw_RP1HctzTvG_BYzwXa7TwZuzafYP95FSA2QCqHoDmg_Jva7FTytW6DhA6upAaRUcCMb5BUbA93TYRIGeziz7a46bCHhefDMqdS9hW45oQBdc_hmC3X3M1Wni6ItxLavI8NvaSPwgB7IMUQCKI1YmmRfpKSgmvLLbF_a2jQpwPvYUiM68quXI85Je-N89AWgLI1oCY2qemeJ1Z8tQfVAj6At4KO8FWq5UbWlnuejiHlicNROi9ajKSFDHowr_RgqZwXP2iciSmvSbycwfbU_46sxV_NTMNaPp9A"
                    ],
                    "views": "818.8K",
                    "datetime": "2024-01-22T14:09:46+00:00"
          },
          {
                    "data_post": "telegram/274",
                    "data_view": "eyJjIjotMTAwNTY0MDg5MiwicCI6Mjc0LCJ0IjoxNzA2MDIxNDM4LCJoIjoiNzFkMGYyYzk2ZDg0NGJlNzBjIn0",
                    "user_url": "https://t.me/telegram",
                    "user_photo": "https://cdn1.cdn-telegram.org/file/nNL6OPWszs6ukBWYYE29IVkpXLnODwiktlGA2cGdDmgEjIzF69xTlYmr6yudxxf47h8HRovBHDJa5zOIluMkVOLQTg-NePGvpUnSD56QzI49__W_PUXMNR11M4VItBvBiwcC3rJsPAh1yKHCwKnoe-GDswGVCZa9pBH-GzTqQbyp6Lku5ZwS5ASI7S-D6eBqvZeH4baj5PShtSXRaQWsFIHhCX-Driia0jtV8mmtZRcSb7sgtusVXrOl1EOk7mTQrzToiq4Y9YEuMUE2_587fq3G3uFCAh-7jIMpdrU7ZxvDuwdZlS9VZRT-LGvrz3P7YLtTzLt_nOXWARpCS8pJNg.jpg",
                    "user_name": "Telegram News",
                    "message_url": "https://t.me/telegram/274",
                    "message_text": "⭐️ Private Message Permissions. Premium users can select who is able to send them messages – either Everyone or My Contacts and Premium Users.  When enabled, users who aren't contacts or don't have Premium can't start chats with you – but can reply if you message them first.  More new features are coming throughout the month, so stay tuned. 😉  January Features 1 • 2 • 3 • 4 • 5",
                    "message_photo": [],
                    "message_video": [
                              "https://cdn1.cdn-telegram.org/file/996f9913df.mp4?token=t19EAOhdLFUijLDFebsVFdqWtuRkm4MDPLVbWhAUaOQnsrd5NbkXSiTFcT2DWsqU1WjATM_7xsMCiNDX1Tk28Q6FNp8QgbWHOxZVGoNvmzI3WzpRUWz5z3en0RdvaL3407GPcXUAB98OWdEe8cgVbR167UMisvaMmAPrsmc3Pvam6WEeTuxZRVrykTfbWHq6FRoiVKKOVsWytGDWSlaG6uhy4ch3Z8F2dE6sAbX7UJeqAcsOkZr3EnC1kNAkly13bEUZ9JNYHh7896VkmaEMkuF8KPQs4TBZ9-t0xzkld5vie1XwFfn7CeTL7bIsAswpLznOaL8SiTq3e4UVQjJvkg"
                    ],
                    "views": "861.0K",
                    "datetime": ""
          }
]

License

MIT