GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - markcellus/social-api-import: Dynamically load Facebook, Twitter, Instagram, Tumblr, or Vine APIs using JavaScript

This repository was archived by the owner on Aug 20, 2020. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

143 Commits
143 Commits

Folders and files

NameName
Last commit message
Last commit date
dist
dist
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.prettierrc
.prettierrc
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
index.js
index.js
 
 
karma.conf.js
karma.conf.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
rollup.config.js
rollup.config.js
 
 
tsconfig.json
tsconfig.json
 
 
tslint.json
tslint.json
 
 

Repository files navigation

Build Status npm version

Social API

This library allows you to asynchronous load multiple social media client API's easy is a standardize way and prevents boilerplate code necessary to load each API's script. Each network's API can be loaded using the same methods and response objects that follow similar schema.

Supports the following APIs:

  • Facebook
  • Tumblr
  • Twitter
  • Instagram
  • Vine

API

constructor([options])

You can pass a standardized set of options to each API:

Parameter Type Description Default Required?
appId String The application ID supplied by the network Yes
version String The api version to use Yes
apiKey String The application key used to access the network's API No
apiSecret String The application secret used to access the network's API No

Certain networks allow additional options outside of the ones we support. You can also pass these as options also. Please see the documentation of the network to find out which addition options properties you can to pass.

import {Facebook} from 'social-api-import';
const fb = new Facebook({appId: 'MyAP33IYEK3y'});

load()

This method allows you to lazily load the api of any social network. It will inject and load any scripts that are required to use the API. It also returns a promise that is the API object of the network.

The following example uses Facebook, but you can also follow this same pattern for each of the other network interfaces (Twitter, Tumblr, Instagram, Vine, etc). Here is an example using Facebook and Twitter.

import {Facebook, Twitter} from 'social-api-import';
const fb = new Facebook({
    appId: 'MyAP33IYEK3y', 
    version: 'v3.2' // use the 3.2 version of Facebook's Graph API
});
fb.load().then((FB) => {
    // API loaded! Now, login
    FB.login();
});

const twitter = new Twitter();
twitter.load().then((twttr) => {
    twttr.widgets.load() // load widgets
})

Development

To run tests:

npm test

About

Dynamically load Facebook, Twitter, Instagram, Tumblr, or Vine APIs using JavaScript

Topics

facebook-apifacebook-sdkinstagram-apiinstagram-sdkloader-scripttwitter-api

Resources

Readme
MIT license
Activity

Stars

11 stars

Watchers

2 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.