Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
pretty sure that's how i did it
@MWBauer make an html element to put it in
and use .html to put the quote in it
(if you're using jquery)
@moT01 thanks
sorry mot01, you can't send brownie points to yourself! :sparkles: :sparkles:
Jose Diaz
@moT01 yep still get 0 length, and [] in the console...
What's the newest version of HTML?
that's not what i got in the example i made @jsd540, do you have code i can see
5 @MWBauer
i think
click my name
Jose Diaz

// list of active users from twitch

var userNameList = ['riotgames','syndicate','summit1g','esl_csgo',
'meclipse','cretetion', 'shroud','officialbjergsen','wolves_bjergsen',
'dreamhackcs','timthetatman','ESL_SC2', 'captainsparklez','goldglove','boxbox',
'swiftor','c9sneaky','storbeck', 'doublelift_renamed300203','doublelift',
'drdisrespectlive','OgamingSC2', 'sivhd','iijeriichoii','faceittv','Faceit',
'omgitsfirefoxx','kinggothalion','habathcx', 'thenadeshot','nadeshot',
'kittyplaysgames','kittyplays','yoda','stonedyooda','RobotCaleb', 'GiantWaffle',
'Gronkh','bobross','nick28t','noobs2ninjas', 'gassymexican','monstercat','cryaotic',

// userNameList array size.

var size = userNameList.length;


// active on click button

// $("button").click(function(){
//   $("button").removeClass("active");
//   $(this).addClass("active");
// });

// listen for a button click to call function

// iterate the userNameList array
// and get necessary data for each user

for(var i = 0; i < size; i++){

    // construct the url

    var user_name = userNameList[i];
    var user_url = 'https://wind-bow.gomix.me/twitch-api/users/';

    user_url += user_name + '?callback=?';

    $.getJSON(user_url, function (user_data) {

    var name = user_data.display_name;     // twitch streamer user name
    var name2 = user_data.name;            // twitch user name to be sent to isItLive
    var logo = user_data.logo;             // streamer logo image
    var bio = user_data.bio;            // streamer bio

    if (bio == null){ // handle null bio case
        bio = 'no bio available';
    else{ // if bio is too long limit size 
        bio = bio.substring(0,125) + "...";
    // send data to isItLive

    isItLive(name, name2, logo, bio);



// this function finds out weather the streamer is
// currently live or if they are off the air.

function isItLive(name, name2, logo, bio){

var user_stream_url = 'https://www.twitch.tv/' + name2; // cunstruct user stream url

// construct url

var stream_url = 'https://wind-bow.gomix.me/twitch-api/streams/';

stream_url += name2 + '?callback=?';

$.getJSON(stream_url, function(liveOrNot){

    // if the streamer is off the air liveOrNot returns null
    // else streamer is currently on the air

    if (liveOrNot.stream != null){

    console.log(name + "  " + bio + " On-line now!");


     console.log(name + " " + bio + " Off-line!");




so your computer can run through code really fast, ...that for loop takes like no time. A getJSON request, however, takes a little more time
so why you aren't able to fill your array is cause the request hasn't returned any values before you try and push it to the array
Kaz Baig
@MWBauer 5 but it is generally assumed that this is the final 'version' -- features will get added over time but they won't increment the version number. This is evidenced by the doctype declaration being simply <!DOCTYPE html> as opposed to <!DOCTYPE html5>
@jsd540 pretty sure that's the problem... change your for loop to a forEach loop
Jose Diaz
ah that makes sense, is there a way to sync so the loop waits for a reply
I need guidance.
@jsd540 that won't be the last time you come across that problem, you might want to figure out how to debug it, i would have console.log the userNameList[i], and also console log the returned data
How do I get text from a website for the Random Quote Generator?
Kaz Baig
@MWBauer You would need to find a quote API
and you would see a list of all the names before any data @jsd540
@jsd540 I haven't done a RESTful call inside a for loop in a while, but you could try creating a promise, then once you get a response from the service you resolve it, and I believe that will sort of "pause" the for loop iterations.
@jsd540 or wrap your RESTful API call inside of an IFFE.
Jose Diaz
@moT01 @ehutchllew thanks guys, I'm gonna re-think this, at least I know what the problem is now...
jsd540 sends brownie points to @mot01 and @ehutchllew :sparkles: :thumbsup: :sparkles:
:cookie: 359 | @ehutchllew |http://www.freecodecamp.com/ehutchllew
:cookie: 878 | @mot01 |http://www.freecodecamp.com/mot01
@jsd540 that forEach loop should fix it, should just need to swap out one line
but, there's other ways as well
@jsd540 Yeah try what @moT01 is saying, the forEach looks at the actual value in the indices of the array rather than a 'counter'.
Jose Diaz
@ehutchllew @moT01 yes, I will try a for each... Dear diary today I learned about for each :) Thanks guys.
jsd540 sends brownie points to @ehutchllew and @mot01 :sparkles: :thumbsup: :sparkles:
api offline
api offline
:bulb: to format code use backticks! ``` more info
return collection[5439].album;
Ken Haduch
@MomchilDeus - looks good :point_up: October 13, 2017 6:13 AM - my last nit-pick - I would like to have either a set of links at the bottom for the different sections, or the nav button frozen to the top of the screen when you scroll up? I know that I'm just being lazy... the site looks great. I really like that timeline presentation!
Jay Vora

hello everyone I have a quick question. any help would be appreciated.
right now

else if({{Page Path}}.indexOf("/xyz/abc") >= 0) return "test";  
but actually i want  to return "test" on /xyz/abc/#employer.

how do i add that hash. If it helps I already have a variable URL fragment = "employers". what would be the best way to add it

i need some help with flex box
anyone thatcan help me please
@RogeMateos yeah