Have problem with Random Quote Machine

Have problem with Random Quote Machine
0

#1

Hi, everybody!
I need some help with my Random Quote Machine. Actually I have an issue:

  1. Function to tweet it doesn’t work at all and I don’t understand why

I will be happy to het some advice about dealing with it
My project: http://codepen.io/KateHamster/pen/dXqqby


#2

Hello Kate :slight_smile:

for the slow quotes, you can remove:

https://crossorigin.me/http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?

for

//api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?

You can now see that the crossorigin website is loading slowly and makes your machine loading slow too, obviously.
If you don’t really need this crossorigin website, leave it. It is now faster.

Hope it helps :slight_smile:

Adrien


#3

Thank you, it helped :slight_smile:
Before it didn’t worked without it


#4

Still have a problem with the tweeting out, maybe someone can me give me a clue what am I doing wrong :slight_smile:


#5

Little change in JS:

var setQuote = function(){
$.getJSON("//api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?", function(data){
$("#quote").text(data.quoteText);
$("#author").text(data.quoteAuthor);

$("a#twitter-link").attr("href","https://twitter.com/intent/tweet?text=" +data.quoteText+" - "+data.quoteAuthor+ "#quote");

});
};

Then modify:


It should make the job :slight_smile: