Socket
Socket
Sign inDemoInstall

github.com/eefret/gravatar

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/eefret/gravatar


Version published

Readme

Source

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("eefretsoul@gmail.com") 
	// prints https://www.gravatar.com/avatar/c82739de14cf64affaf30856ca95b851.jpg?d=&r=g&s=80
	
	g.SetSize(uint(256))
	data, err := g.Download("eefretsoul@gmail.com")
	// Returns []byte containing the Image with modified size to 256px
	
	g.SetSize(uint(512))
	g.DownloadToDisk("eefretsoul@gmail.com", "/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:

FAQs

Last updated on 01 Dec 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc