Skip to content

Commit

Permalink
Add demo fiddle
Browse files Browse the repository at this point in the history
Add https prefix to gravatar. More simple avatar array
  • Loading branch information
icebob committed May 25, 2016
1 parent 7a7ee99 commit 946b862
Show file tree
Hide file tree
Showing 8 changed files with 1,308 additions and 1,291 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# fakerator [![NPM version](https://img.shields.io/npm/f/fakerator.svg)](https://www.npmjs.com/package/fakerator)
> Random data generator with localization
> Random fake data generator with localization
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/939fc8b138a64c65b9827543e30dab39)](https://www.codacy.com/app/mereg-norbert/fakerator?utm_source=github.com&utm_medium=referral&utm_content=icebob/fakerator&utm_campaign=Badge_Grade)
[![Build Status](https://travis-ci.org/icebob/fakerator.svg?branch=master)](https://travis-ci.org/icebob/fakerator)
[![Coverage Status](https://coveralls.io/repos/github/icebob/fakerator/badge.svg?branch=master)](https://coveralls.io/github/icebob/fakerator?branch=master)

[![Dependency Status](https://david-dm.org/icebob/fakerator.svg)](https://david-dm.org/icebob/fakerator)
[![devDependency Status](https://david-dm.org/icebob/fakerator/dev-status.svg)](https://david-dm.org/icebob/fakerator#info=devDependencies)
[![Downloads](https://img.shields.io/npm/dt/fakerator.svg)](https://www.npmjs.com/package/fakerator)
[![Downloads](https://img.shields.io/npm/dt/fakerator.svg)](https://www.npmjs.com/package/fakerator)


## Demo
[JSFiddle test page](https://jsfiddle.net/icebob/wngcbpkq/)
22 changes: 14 additions & 8 deletions dist/fakerator.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions dist/fakerator.min.js

Large diffs are not rendered by default.

1,268 changes: 0 additions & 1,268 deletions lib/locales/default/internet/avatar.js

This file was deleted.

9 changes: 6 additions & 3 deletions lib/locales/default/internet/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import passwordGen from "vendor/password-generator";
import crypto from "crypto";
import uifaces from "./uifaces";

module.exports = {
avatar: require("./avatar"),

tld: require("./tld"),

userName(firstName, lastName) {
Expand Down Expand Up @@ -101,11 +100,15 @@ module.exports = {
(blueStr.length === 1 ? "0": "") + blueStr;
},

avatar() {
return `https://s3.amazonaws.com/uifaces/faces/twitter/${this.random.arrayElement(uifaces)}/128.jpg`;
},

gravatar(email) {
if (email == null) {
email = this.internet.email();
}

return "//www.gravatar.com/avatar/" + crypto.createHash("md5").update(email).digest("hex");
return "https://www.gravatar.com/avatar/" + crypto.createHash("md5").update(email).digest("hex");
}
};
Loading

0 comments on commit 946b862

Please sign in to comment.