Skip to content

fodilo/Random-Quote-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random-Quote-Generator

The project objective is in "https://www.freecodecamp.org/challenges/build-a-random-quote-machine"

Synopsis

Build an app which let us getting Random Quote using web service and retrieving data with JSON format. And As "User" I can tweet the quotes that I want

Code Example

var tweet="https://twitter.com/intent/tweet?text=";
var url = "http://api.forismatic.com/api/1.0/?method=getQuote&key=457653&format=jsonp&lang=en&jsonp=?";
$.getJSON(url,function (data){
document.getElementById('quote').innerHTML=data.quoteText;
document.getElementById('quotebox').style.backgroundColor =colors[Math.round(10*Math.random())];

if (data.quoteAuthor =="")document.getElementById('quote-sayer').innerHTML="Unknown";
else {document.getElementById('quote-sayer').innerHTML=data.quoteAuthor;}
tweet=tweet+"' "+data.quoteText+"' ."+'\u000D Author :'+document.getElementById('quote-sayer').innerHTML;

document.getElementById("tweet").href=tweet;

});

API Reference

Author

B.FODIL : Front End web developer , STUDENT At : ECOLE SUPERIEUR D'INFORMATIQUE Camper At : FREECODECAMP

Acknowledgments

Thanks to QUINCY LARSON and FREECODECAMP