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
Liam Docherty
@ldocherty1
@korzo My bad just realised my mistake
Adinarayana Raghu
@adinarayaanraghu95
Hey.
I am looking for developers to collaborate for a social education project
Jorge
@flawedLogic506
@adinarayaanraghu95 what's it about?
Adam Faraj
@adamfaraj
hello everyone
was hoping someone here can help me
i'm trying to access the text within my <div class="wthr"></div>
rafaelmonroy
@rafaelmonroy

hey everyone, I am having a hard time with ajax, posting on twitter with ajax, can someone lend a hand? here is my code so far.


$(document).ready(function(){

  $("#btn").on("click", function(){
    $("#tweet").delay(1500).fadeIn();
    $.ajax({
      type: "GET",
      url: "https://talaikis.com/api/quotes/random/",
      success: function(quotes){
          $("#quote").html("Author: "+quotes.author+"<br> Quote: "+quotes.quote+"<br>")
      },
      error: function(){
        alert("error loading quotes");
      }
    }) 
  });

  $("#tweet").on("click", function(){
    var tweet = {
      tweetQuote: "test"
    };
    $.ajax({
      type:"POST",
      datatype:"jsonp",
      url: "https://api.twitter.com/1.1/statuses/update.json",
      data: tweet,
      success: function(){
        console.log("tweet sent");
      },
      error: function(){
        alert("error sending tweet");
      }
    })
  });

});

i keet getting my error message when i try to POST my quote

Mercy Manrique
@mers89
I had a question on the Twitch API. should my link to the API url work when the channel is offline? It was working fine on Friday when it was showing it was online I had created a link to https://wind-bow.glitch.me/twitch-api/streams/freecodecamp
iso
@iso1048
@rafaelmonroy dont know about POST but it is easier to use a tweet web intent: https://dev.twitter.com/web/tweet-button/web-intent, https://dev.twitter.com/web/tweet-button. if you do want to use a tweet web intent, those links will be helpful
rafaelmonroy
@rafaelmonroy
@gothamknight thanks!
CamperBot
@camperbot
rafaelmonroy sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 404 | @gothamknight |http://www.freecodecamp.com/gothamknight
Mercy Manrique
@mers89
@gothamknight do you mind helping me on my code. It was the same as Fiday? I dont know why it stopped working
Johnny
@jtan3
@rafaelmonroy sometimes channels will be offline. You can just provide their url when they're offline.
iso
@iso1048
@mers89 when the user is online, you can access the data using https://wind-bow.glitch.me/twitch-api/streams/freecodecamp. when the user is offline, you can make a new ajax call using the channel route https://wind-bow.glitch.me/twitch-api/channels/freecodecamp
Mercy Manrique
@mers89
@gothamknight so when the user is offline there is no access to the data using the same link
Ayush Bahuguna
@relentless-coder
Need some help with css
https://codepen.io/ayushb/pen/EverBx
I am trying to have the tiny dots before the links in the sub menu the way it appears on the main menu item
iso
@iso1048
@mers89 yeah
Jorge
@flawedLogic506
@adamfaraj what seems to be the problem?
Adam Faraj
@adamfaraj
@OrangeKulture i want to change the weather icon based on what the weather is, ie: clear, rain, clouds, etc
iso
@iso1048
@mers89 so when you make the first ajax call using the streams route, you can check if json.stream == null. If so, then make a new ajax call using the channels route (if you want to get data). If json.stream !== null, then you can access the data in the json of the first ajax call. That is just one way to do it. Does that make sense?
Mercy Manrique
@mers89
@jtan3 I was just tryng to see if my code was broken or if it was just an online/offline thing. Ir was working fine on friday
Adam Faraj
@adamfaraj
so i wanted to do an if else statement @OrangeKulture . ```if (dom.wthr[0].innerHTML == "Clear") { then change picture, etc etc}
console.log(dom.wthr) gives me the object
won't let me access the text within that div
iso
@iso1048
@adamfaraj can you not access the url for the image from the json?
Johnny
@jtan3
@mers89 if you provide your codepen it would easier to see the problem.
Mercy Manrique
@mers89
@gothamknight @jtan3 it's the section where it says "Free Code Camp is currently offline. Before I was able to click and it would take me to the URL of twitch TV for FCC
Ayush Bahuguna
@relentless-coder
@mers89 I think a good way to test your project is get more data, you can have more data from twitch's api. But I had worked on that problem a long time ago, and maybe things have changed.
Johnny
@jtan3
@mers89 you haven't linked the offline part to anything yet ?
Mercy Manrique
@mers89
@ayush but isnt a URL a URL link or does the API override that. Im not sure whether the channel being offline breaks the link'
Ayush Bahuguna
@relentless-coder
@mers89 @jtan3 twitch api works without client id??!!!
Johnny
@jtan3
@relentless-coder yes with the new https://wind-bow.glitch.me/twitch-api/streams/ESL_SC2
iso
@iso1048
@relentless-coder using a different endpoint, so yeah.
@mers89 Could you rephrase your question - I'm not sure what you are asking.
Adam Faraj
@adamfaraj
@gothamknight i don't have a url for the images
Ayush Bahuguna
@relentless-coder
@gothamknight but does this work if I want to fetch all the live streams?
iso
@iso1048
@adamfaraj so you want to have like a background image or something which changes based on the weather?
Mercy Manrique
@mers89
@gothamknight I was using var url= "https://wind-bow.glitch.me/twitch-api/streams/freecodecamp"; and it will create a link on my page that said "Free Code Camp is currently offline/online" and you can click on it and it would take you to the URL. Today that I looked at it that the channel was offline it just showed up at text on the page saying it was offline and it wasnt a link anymore
Jorge
@flawedLogic506
@adamfaraj sry.. spaced out for a sec .. looking now
@adamfaraj i see you do have the Clouds displayed... isnt that from the json?
Johnny
@jtan3
@mers89 you need use an a tag and provide the stream's url from the api's data.
Jorge
@flawedLogic506
@mers89 u also have to take into account that when u do set it up correctly, the link might take you to the channel within the twitch website, but it wont work .. only way it works is on debug mode
iso
@iso1048
@mers89 I am not sure what is happening there. You could try seeing what happens when you use a user who is online.
@relentless-coder I have only used that endpoint for what the fCC challenge required.
Adam Faraj
@adamfaraj
@OrangeKulture yes, but i hate those pictures. i have new pictures i want to use based on the weather