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
Hemang Kumar
@hemangsk
"cross origin request" something...pops up when we forget to put that "&callback=?" thing in api url
Coy Sanders
@coymeetsworld
hmm don't think I've seen that before, were we working on the Weather API stuff? I haven't been doing any of that the last 2 days trying to put some work in now lol
Hemang Kumar
@hemangsk
@coymeetsworld Yaaa our last encounter with CORS was when we were working on weather api stuff :)
Coy Sanders
@coymeetsworld
oh you're talking about when we didn't specify the protocol in the URL right @hemangsk ?
left out the http:// in the API call?
Thanasis S.
@xakersas
hello
so i want to allign my list both in the center
and left
Azrul Zulkifli
@azrulnaut

Hi guys and girls, I'm working on the weather report project. As the open source weather API only allows hourly calls, to help me while I'm working on it, I decided to copy the JSON file an upload a copy on dropbox. For some reason, my code doesn't check out.

     var apiURL = "https://www.dropbox.com/s/dg2606z3hhpxj9q/weathertest.json?raw=1&callback=?";

function getPosition() {
  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(showPosition);
  }
}

function showPosition(position) {
  $.getJSON(apiURL, function(json) {
    var lat = position.coords.latitude;
    var long = position.coords.longitude;
    var weather = "";
    weather += json.name + ", " 
      + json.weather[0].id + "<br>"
      + json.weather[0].icon + "<br>"
      + json.main.temp + " Kelvin<br>Longitude: " 
      + long + "Latitude: " + lat;
    $('.weather').html(weather);
  });
}

(document).ready(getPosition());

Hope someone could lend a hand.

Coy Sanders
@coymeetsworld
you need to call the JSON.stringify method
@azrulnaut
to convert that to a JSON object
Hemang Kumar
@hemangsk
@bkilrain I am not able to figure it out, your approach is completely correct... Found an API which works.. http://www.icndb.com/api/
Brian Kilrain
@bkilrain
Ok… thanks again. I’ll try that other api :)
here is the url I’m attempting to use. It works! But how can I get the function quoter(json) to display on the site?
Hemang Kumar
@hemangsk
@bkilrain Cool lemme see
Brian Kilrain
@bkilrain
i dont’ care about formatting right now… just JSON.stringify would be fine
Azrul Zulkifli
@azrulnaut
thanks @coymeetsworld will try that!
CamperBot
@camperbot
azrulnaut sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star: 310 | @coymeetsworld | http://www.freecodecamp.com/coymeetsworld
Coy Sanders
@coymeetsworld
gl @azrulnaut i'm working on this one too
actually now that i tried it @azrulnaut i didn't have to do that, hmmm
tried plugging in your reference to dropbox, are you getting forbidden error?
you may not be able to reference Dropbox data from outside, I'm not sure where I heard that from exactly
Azrul Zulkifli
@azrulnaut
@coymeetsworld At first I got the forbidden error but I added 'callback?=0' to the url
now the error seems to be a syntax error in my json
which is strange
anyway, this is my json url = ""https://www.dropbox.com/s/dg2606z3hhpxj9q/weathertest.json?raw=1&callback=?" opening it in the browser seems fine
maybe i'll try a different hosting site for the json.
thanks again
Coy Sanders
@coymeetsworld
yeah in the browser is one thing, codepen may disallow those things
i would try just using the API if you can, that way you eliminate possible errors with this way
im using free version of API i haven't ran into too many calls issue
one thing you can do is prevent autorun from happening in codepen, manually trigger a run when you want, maybe that will help
Azrul Zulkifli
@azrulnaut
Hmm, how do you control when the call trigger?
Ah, the autoupdate!
Of course! Alright @coymeetsworld , this dropbox plotline has steered me off course, thanks for reminding me to stay on track, haha. Will get back to the API.
CamperBot
@camperbot
azrulnaut sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:warning: azrulnaut already gave coymeetsworld points
Coy Sanders
@coymeetsworld
right, you got me worried i might go over my calls too so i shut it off lol @azrulnaut thanks for that idea
CamperBot
@camperbot
coymeetsworld sends brownie points to @azrulnaut :sparkles: :thumbsup: :sparkles:
:star: 278 | @azrulnaut | http://www.freecodecamp.com/azrulnaut
Hemang Kumar
@hemangsk
Brian Kilrain
@bkilrain
@hemangsk strange… the preview within the git chat window appears to work. But when I open the codepen in my browser, it doesn’t.
I just tried it in firefox… that worked. does codepen not play nice with chrome? or could it be one of my plugins is messing things up?
@hemangsk thank you for working this out with me
Hemang Kumar
@hemangsk
@bkilrain np..it was great learning.. thank you
CamperBot
@camperbot
hemangsk sends brownie points to @bkilrain :sparkles: :thumbsup: :sparkles:
:star: 279 | @bkilrain | http://www.freecodecamp.com/bkilrain
Brian Kilrain
@bkilrain
it was one of my plugins… thanks again!