Git Product home page Git Product logo

gravatar's Introduction

Gravatar for Golang

Gravatar is a tiny go library for accessing gravatar.com avatar images.

Usage example

import "github.com/eefret/gravatar"

func main(){
	g, err := gravatar.New() //Creating our object to hold preferences: size, defaultImg, rating
	
	g.URLParse("[email protected]") 
	// prints https://www.gravatar.com/avatar/c82739de14cf64affaf30856ca95b851.jpg?d=&r=g&s=80
	
	g.SetSize(uint(256))
	data, err := g.Download("[email protected]")
	// Returns []byte containing the Image with modified size to 256px
	
	g.SetSize(uint(512))
	g.DownloadToDisk("[email protected]", "/tmp/avatar.jpg")
	// Saves to /tmp our avatar image file with a size of 512
	
	if err != nil {
		log.Fatal(err)
	}
}

License

You can use gravatar under the terms of the Apache v2 license:

gravatar's People

Contributors

eefret avatar wunderkind2k1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gravatar's Issues

Export methods

There are a couple of methods that currently aren't being exported by the package but I think only make sense if they are exported (E.g. Gravatar.setSize or Gravatar. setDefaultImage). Could you please export them?

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.