https://github.com/tryolabs/social-media-scraper
Scrapes social media handles out of websites.
https://github.com/tryolabs/social-media-scraper
node-js node-module nodejs webscraping
Last synced: 9 months ago
JSON representation
Scrapes social media handles out of websites.
- Host: GitHub
- URL: https://github.com/tryolabs/social-media-scraper
- Owner: tryolabs
- License: apache-2.0
- Created: 2018-11-08T19:55:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-02T16:49:29.000Z (over 3 years ago)
- Last Synced: 2024-12-13T21:12:30.012Z (over 1 year ago)
- Topics: node-js, node-module, nodejs, webscraping
- Language: JavaScript
- Size: 155 KB
- Stars: 20
- Watchers: 5
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Social Media handles scraper
A node.js module to extract social media handles out of websites
## Features
A single configurable function that take several websites to extract and returns an array of social media handles.
## Installation
using npm:
```
$ npm i social-media-scraper
```
using yarn:
```
$ yarn add social-media-scraper
```
## Examples
```
const getHandles = require('social-media-scraper').default
const websites = ['https://your-web-site-1.com', 'https://your-web-site-2.com']
getHandles(website)
.then(handles => handles.map(handle => console.log(handle))
.catch(error => console.error(error))
```
## API
### Handles extractor
##### `getHandles(urls: Array | string) => Array<{ [website]: { [social_network]: Array }>`
Returns an array of object containing the website's url containing and object in which the keys are the social network identifiers with the handles extracted attached.
```
[
{
"https://your-web-site.com/": {
"facebook": ["YourHandle"],
"twitter": ["YourHandle"],
"linkedin": ["YourHandle"],
"pinterest": [],
"tumblr": [],
"soundcloud": [],
"instagram": [],
"youtube": ["YourHandle"],
"snapchat": []
}
}
]
```
### Config
Simply edit the ```socialMediaScraper.CONFIG``` array, supported social network are stored in the ```socialMediaScraper.SUPPORTED_NETWORKS``` set.
```
socialMediaScraper.CONFIG = ['twitter', 'facebook', 'my-space']
```