Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 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
tommy
@tommygebru
regStreamers.map(function(val) {
$.getJSON(twitchAPI + streams + val + callback, function(data1) {
            if (data1.status === 404) {
                $(".wrap").append("<div class='streamers offline delete'><span class='i-fix'><i class='ion-close'></i><img src='https://68.media.tumblr.com/2bab580406f69a3ff294bd0782d83c5a/tumblr_ohkte1EwLM1sj6gx1o1_540.png'></span><div class='info'><span>" + val + " </span><span>does not exist</span></div></div>");
                $(".offline i").click(function() {
                    $(this.closest(".delete")).remove();
  });
            } else if (data1.status === null) {
                $.getJSON(twitchAPI + channels + val + callback, function(data2) {
                    $(".wrap").append("<a href=" + data2.url + "><div class='streamers offline'><img src='https://68.media.tumblr.com/2bab580406f69a3ff294bd0782d83c5a/tumblr_ohkte1EwLM1sj6gx1o1_540.png'><div class='info'><span>" + val + " </span><span>is currently offline</span></div></div></a>");
                });
            } else {
                $(".wrap").append("<a href=" + data1.stream.channel.url + "><div class='streamers online'><img src=" + valData.stream.channel.logo + "><div class='info'><span>" + val + " </span><span class='game'>streaming " + valData.stream.game + "</span><span>" + valData.stream.viewers + " viewers</span></div></div></a>");
            } //ELSE
        }); //data1
});//map
Abhishek Kumar
@Mr-Kumar-Abhishek
@swatbone85 probably your html structure messes around after the first run your script
Thomas Swatland
@swatbone85
@Mr-Kumar-Abhishek Yeah that may be it. I'll dig a little deeper, thank you!
CamperBot
@camperbot
swatbone85 sends brownie points to @mr-kumar-abhishek :sparkles: :thumbsup: :sparkles:
:warning: swatbone85 already gave mr-kumar-abhishek points
Abhishek Kumar
@Mr-Kumar-Abhishek
@swatbone85 after js changes your html it should still maintain <h3><a>your text</a></h3> no texts between h3 and a
@swatbone85 I making js fiddle to show you ...
tommy
@tommygebru
@Adi2Point0 @swatbone85 basically i was able to get all working but when i mixed the jsons together only 2/3 conditions would execute code not all 3 though...
data1 is pulling from this json https://wind-bow.hyperdev.space/twitch-api/streams/ESL_SC2
data2 is pulling from this json https://wind-bow.hyperdev.space/twitch-api/channels/ESL_SC2
I want to be able to create anchor links and wrap divs...
however because some streamers are offline... I have to change the api call to get the url from a different json
tommy
@tommygebru
oops ok i fixed some of it
but still the same problem
regStreamers.map(function(val) {
        $.getJSON(twitchAPI + streams + val + callback, function(data1) {
            if (data1.status === 404) {
                $(".wrap").append("<div class='streamers offline delete'><span class='i-fix'><i class='ion-close'></i><img src='https://68.media.tumblr.com/2bab580406f69a3ff294bd0782d83c5a/tumblr_ohkte1EwLM1sj6gx1o1_540.png'></span><div class='info'><span>" + val + " </span><span>does not exist</span></div></div>");
                $(".offline i").click(function() {
                    $(this.closest(".delete")).remove();
                });
            } else if (data1.status === null) {
                $.getJSON(twitchAPI + channels + val + callback, function(data2) {
                    $(".wrap").append("<a href=" + data2.url + "><div class='streamers offline'><img src='https://68.media.tumblr.com/2bab580406f69a3ff294bd0782d83c5a/tumblr_ohkte1EwLM1sj6gx1o1_540.png'><div class='info'><span>" + val + " </span><span>is currently offline</span></div></div></a>");
                });//data2
            } else {
                $(".wrap").append("<a href=" + data1.stream.channel.url + "><div class='streamers online'><img src=" + data1.stream.channel.logo + "><div class='info'><span>" + val + " </span><span class='game'>streaming " + data1.stream.game + "</span><span>" + data1.stream.viewers + " viewers</span></div></div></a>");
            } //ELSE
        }); //data1
    }); //map
Adi2Point0
@Adi2Point0
@tommygebru I wish I could help. But the APIs seem to have been blocked at my work proxy
so can't get the data
tommy
@tommygebru
@Adi2Point0 ok no worries...
i am not sure it has to do with the api links maybe has to do with the logic of the if statement?
Abhishek Kumar
@Mr-Kumar-Abhishek
@swatbone85 is this is how you have done conceptually ? https://jsfiddle.net/st7qaeu2/8/
@swatbone85 https://jsfiddle.net/st7qaeu2/11/ ... new...
Thomas Swatland
@swatbone85
@Mr-Kumar-Abhishek Yes. Maybe something changes in the html. I tried using a button to convert instead of the text, and then it works fine. Although I'd rather not use a button, but click the text like I'm doing here.
Sorin Ruse
@sorinr
@tommygebru as far as i know, the twitch api from august or so, requires you get an registered user key. its free but you have to register
kirbyedy
@kirbyedy
I think fcc did something about that twitch api, I saw couple of times people using some hyperdev link
to bypass that client-id process
tommy
@tommygebru
i posted the links earlier @kirbyedy @sorinr
Sorin Ruse
@sorinr
@kirbyedy yep. u r right. read about it somewere
tommy
@tommygebru
Screen Shot 2016-12-05 at 12.21.43 AM.png
this screenshot shows that the first if condition passes and the last else condition passes.....
but then that leaves the second condition else if, which does not pass
Sorin Ruse
@sorinr
@tommygebru i think here else if (data1.status === null) is the problem. it shouldn't be data1.status but data.stream or something like this
tommy
@tommygebru
@sorinr omg you are a god :angel:
Sorin Ruse
@sorinr
@tommygebru if you console.log(data1.status) will probably get 200,404 etc
tommy
@tommygebru
that did it
yeah
im using atom right now its so difficult!!!
Sorin Ruse
@sorinr
using atom too and i feel very comfortable with it
Abhishek Kumar
@Mr-Kumar-Abhishek
@sorinr you devs with all the big nasty machines .. I have to resort to using vim, emacs or at most geany
::p
:p
Sorin Ruse
@sorinr
@Mr-Kumar-Abhishek i don't like atom when using big css files. it moves too slower but i open the file in notepadqq and edit it there
Abhishek Kumar
@Mr-Kumar-Abhishek
@sorinr some say sublime text is lighter .... I don't know... tried using it ??
tommy
@tommygebru
oh yeah atom is super slow and other issues too
Abhishek Kumar
@Mr-Kumar-Abhishek
@tommygebru I haven't used sublime text... but was thinking of compiling 'lime text' instead
Sorin Ruse
@sorinr
also sublime its quite nice. i suspect my issue with atom is the pigment package i'm using for colors
Abhishek Kumar
@Mr-Kumar-Abhishek
@sorinr yes atoms needs a lot of work in optimisation .... I may as well look its source code ...
@sorinr yes atom needs a lot of work in optimisation .... I may as well look its source code ...*
https://github.com/atom/atom this is too much history :/
tommy
@tommygebru
so i am done! I just have to fix some of the new errors on the github version tomorrow
Sorin Ruse
@sorinr
@tommygebru :+1:
evakri
@evakri
Hey guys, that's a noob question, but what's the way to make a page design like this?
alpox
@alpox
Sublime is fast and people like to use it.
I myself prefer Visual Studio Code quite much to all of the others because it has better IDE possibilities
(Git integration, Integrated Plugin System, Debugger...)
And its as fast as Sublime Text
https://code.visualstudio.com/?utm_expid=101350005-35.Eg8306GUR6SersZwpBjURQ.0&utm_referrer=https%3A%2F%2Fwww.google.de%2F
@evakri You can inspect the code to see:
https://codepen.io/FreeCodeCamp/pen/ONjoLe
evakri
@evakri
Oh, thanks, didn't notice that the editor view is available
Abhishek Kumar
@Mr-Kumar-Abhishek
@alpox I was trying to install intelij a few hours ago nearly burnt my computer doing that.... I have to make my own editor some day it seems lol