Skip to content

cinema6/spidey.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spidey.js

Overview

Spidey.JS is a library for scraping social media links from webpages. By default, it will fetch links to the website's corresponding Facebook, Twitter, Instagram, YouTube, Pinterest, Google+, and Tumblr pages, and the profile picture from their Facebook page (if their Facebook page is found.)

API

spidey(uri, [options])

Uses request to fetch the webpage, and scrapes it for social media links.

  • Parameters

    • uri (String): URI of the webpage to scrape.
    • [options] (Object): Configuration Object to pass to request.
  • Returns

    • Promise: A bluebird Promise that will be fulfilled with an object in the following format:
    {
        "links": {
            "facebook":     "..." || null,
            "twitter":      "..." || null,
            "instagram":    "..." || null,
            "youtube":      "..." || null,
            "pinterest":    "..." || null,
            "google":       "..." || null,
            "tumblr":       "..." || null
        },
        "images": {
            "profile":      "..." || null
        }
    }

spidey.configure(links)

Globally reconfigures spidey() to scrape for new configured links (in addition to the defaults.)

  • Parameters

    • links (Object): An Object in the following format:
    {
        // Will search for friendster social links by
        // first searching for links that contain
        // "friendster.com" and then searching for links
        // that contain "friendst.er." Will not include any
        // links that contain "/share/".
        "friendster": [
            "friendster.com",
            "friendst.er",
            "!/share/"
        ],
    
        // Reconfigures the Facebook link lookup to also
        // search for links that contain "fb.me."
        "facebook": ["facebook.com", "fb.me"]
    }
  • Returns

    • Function: A reference to spidey.
    var spidey = require('spidey');
    
    spidey.configure({ myspace: ['myspace.com'] })('http://some-website.com')
        .then(result => console.log(result.links.myspace));

About

Crawls a webpage for social media links.

Resources

Stars

Watchers

Forks

Packages

No packages published