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

elsewhere-mapper

v0.1.2

Published

Social media profile endpoint mapper

Downloads

6

Readme

elsewhere-mapper

The elsewhere-mapper is a social media profile endpoint mapper, it is part of a collection of node.js modules that enable the discovery of profiles and identities an indivdaul creates across the web.

Install

npm install elsewhere-mapper

or

git clone http://github.com/glennjones/elsewhere-mapper.git
cd elsewhere-mapper
npm link

Use

with list of URLs

var mapper = require("elsewhere-mapper");

mapper.parseUrls('http://glennjones.net/about', function(data){
    // do something with data
});

with list of SGNs

var mapper = require("elsewhere-mapper");

mapper.parseSgns('sgn://twitter.com/?ident=glennjones', function(data){
    // do something with data
});

with JSON from elsewhere module

var mapper = require("elsewhere-mapper");

mapper.parseElsewhereJson({ data object... },  function(data){
    // do something with data
});

Response

This will return JSON. This is an example where three urls where given: http://github.com/glennjones, https://github.com/glennjones/elsewhere-mapper, http://glennjones.net

{
    "identities": [{
        "name": "Github",
        "domain": "github.com",
        "matchedUrl": "http://github.com/glennjones",
        "userName": "glennjones",
        "sgn": "sgn://github.com/?ident=glennjones",
        "endPoints": [{
            "schema": "Atom",
            "contentType": "Activity",
            "mediaType": "Atom",
            "url": "https://github.com/glennjones.atom"
        }, {
            "schema": "hCard",
            "contentType": "Profile",
            "mediaType": "Html",
            "url": "https://github.com/glennjones"
        }, {
            "schema": "XFN",
            "contentType": "Services",
            "mediaType": "Html",
            "url": "https://github.com/glennjones"
    }],
    "domainsNotMapped": [{
        "url": "http://glennjones.net/"
    }],
    "urlsNotParsed": [{
        "url": "https://github.com/glennjones/elsewhere-mapper"
    }]
}

Using the server API

Once you've cloned the project and run npm install, run the server $ node bin/elsewhere-mapper and then point your browser at localhost:8881 to try it out.

The server API will take either a single value or a comma delimited list of URLs/SGNs. Alternatively you can also pass it a JSON string from the output of the elsewhere node.js module. Finally it supports a callback querystring item for use with any of the other three data types.

GET http://localhost:8881/?urls=http%3A%2F%2Ftwitter.com%2Fglennjones&callback=myFunction

Adding a new site to elsewhere-mapper

It is easy to add a new site to the list that elsewhere-mapper maps. Each site has its own mapping file, which contains a simple description in JSON of the site and a group of urltemplates for matching. This is the mapping file for dopplr.com

{
    "name": "Dopplr",
    "domain": "dopplr.com",
    "urlMappings": [{
        "urlTemplate": "http://dopplr.com/traveller/{username}",
        "schema": "hCard",
        "contentType": "Profile",
        "mediaType": "Html"
    }, {
        "urlTemplate": "http://dopplr.com/traveller/{username}/public",
        "schema": "None",
        "contentType": "None",
        "mediaType": "Html"
    }],
    "www": true
}

First make sure you have the development version of elsewhere-mapper by using the following command

npm install --dev 

to download the package. To add a site create a new map file and add it into the maps directory. Follow the simple structure from another map file changing the values. Then create a 16x16 pixel png icon file for your site and place it in the icons directory. The icon can be copied from the favicon of the site, but it has to be in the png format.

Once you have created the map and icon files we need to compact them into the main project files. Run node.js locally using the command

$ node bin/elsewhere-mapper 

in the elsewhere-mapper directory and then point your browser at localhost:8881/compress-maps/ you should see the word “done”. To compress the images install glue on your mac navigate to the elsewhere-mapper directory using the command execute

$ glue --html --optipng --watch icons sprites.

Contributing to the project

Please use github to ask me to pull your additions or corrections. The more people that help maintain this project the better the quailty of data.

Support or Contact

Having trouble with elsewhere-mapper? Please raise an issue at: https://github.com/glennjones/elsewhere-mapper/issues

License

The project is open sourced under MIT licenses. See the license.txt file within the project source.