Coder Social home page Coder Social logo

twivatar's Introduction

No longer works

Twitter has managed to finally kill this (and related) projects. Sorry, I've looked and I can't see a solution.

Twivatar

Twivatar is a RESTful API to a Twitter user's avatar built out of frustration of external Twitter apps breaking when the avatar url is stored, and then changed by that user later on Twitter - the result is a broken image on that app unless they constantly check for profile changes.

Usage

<img src="https://twivatar.glitch.me/[screen_name]" />

Alternatively you can specify the size image you want from:

  • mini (24x24)
  • normal (48x48 - default)
  • bigger (73x73)
  • original

<img src="https://twivatar.glitch.me/[screen_name]/[size]" />

Behind the scenes

This is a simple one script app that stores the url of the avatar. When the avatar is requested for x user, it runs the following logic:

  1. Get the mobile HTML from twitter
  2. Run the HTML through cheerio and find the .Avatar element
  3. Request the image URL and pipe to the response
  4. All requests also include CORS headers so you can manipulate in a canvas

License

MIT: http://rem.mit-license.org

twivatar's People

Contributors

remy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.