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
  • Aug 17 01:43
    @bjorno43 banned @linkin-park
  • Jun 20 21:20
    @bjorno43 banned @shenerd140
  • May 10 09:13
    @bjorno43 banned @zhaokunhaoa
  • Apr 27 19:47
    @mstellaluna banned @zhonghuacx
  • Apr 25 17:12
    @mstellaluna banned @cmal
  • Jan 08 22:00
    @mstellaluna banned @dertiuss323
  • Dec 15 2018 23:36
    @mstellaluna banned @18835579411
  • Dec 13 2018 23:57
    @mstellaluna banned @brandon6190
  • 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:13
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:58
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:15
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
Darryl Pargeter
@darrylpargeter
@jonslucas the best thing to do is ditch google and go with bing… yes bing, or imgur they have nice apis
Jon Lucas
@jonslucas
Hmmm, I'll have to look into that. It's a little disappointing that I can't seem to figure it out though. It seems rather simple, like I'm just missing a certain query param in my request. And I can't seem to find the right google search term to get to the answer I'm looking for.
Thanks @darrylpargeter
CamperBot
@camperbot
jonslucas sends brownie points to @darrylpargeter :sparkles: :thumbsup: :sparkles:
:star: 744 | @darrylpargeter | http://www.freecodecamp.com/darrylpargeter
Darryl Pargeter
@darrylpargeter
google search api was a bitch took me a long time to get it working, if you show me your code can try to help you (but coming form someone who used google api would say ditch it on the side of the road)
Jon Lucas
@jonslucas
here is the link to the pertinent function I'm using to call the api:
https://github.com/jonslucas/fcc-imgsearchabstraction/blob/master/app/controllers/imgSearch.server.js
but, I guess it's not too much trouble to just scrap it and start with the bing API
Anders Bengtsson
@anders462

@Rafase282 Flow:

  1. register user, save user with hashed password (I used bcrypt)
  2. login: compare hashed passwords and if ok, create JWT, (I used "jsonwebtoken" npm mod) send back in res to client
  3. client send JWT in req, >> I did a simple middleware mod, that checks the JWT validity before routing to the protected route!

To logout user, you can simple delete token on the client side, but there are a way to revoke the token from server as well.

  • Protect your secret string, I put in .env
  • When you create token, don't forget to mask password in user object as the token is not encrypted only encoded, anyone can easily read a token
Rafael J. Rodriguez
@Rafase282
@anders462 have you streamed before?
Anders Bengtsson
@anders462
nope. haven't
Darryl Pargeter
@darrylpargeter
@jonslucas would say thats the best think bing has a module for it to make life even easyer if you google it plus 5,000 calls a month is better then 100 a day
Anders Bengtsson
@anders462
@Rafase282 what do you use, I be happy to do it
Rafael J. Rodriguez
@Rafase282
OBS to stream. I'm trying to fill a gap, the streams are either bonfires or FCC bug fixes or Musare, so I'm tryign to add API Backend and related front end dev while working on my project because I doubt people will sit to watch me write articles for the wiki. But the idea was to show you my api and then we can come up with a decent way to provide security, so far mine works but I'm still a noob. @anders462
Jon Lucas
@jonslucas
@darrylpargeter Yeah, I don't really think that I'll be hitting either of those api limits, so that's rather a non issue for me. It's more that it's frustrating to get so close to finish line and to have to start over practically because of something that seems so trivial
Anders Bengtsson
@anders462
@Rafase282 I am a noob as well :-)
Rafael J. Rodriguez
@Rafase282
but you seem to have more experience, with a proper working implementation
Anders Bengtsson
@anders462
@Rafase282 well,,i am stubborn, but if its anything I can do to help, I be happy to. how do we pair (never done it)
Rafael J. Rodriguez
@Rafase282
skype and c9? or screenhero and c9?
Anders Bengtsson
@anders462
Skype haven't used c9 or screenhero
skypeid andben462
Rafael J. Rodriguez
@Rafase282
well the code is on c9 ;-)
Anders Bengtsson
@anders462
ok, let's see if I signed up, never used it though
sigursiguros
@sigursiguros
@sigursiguros
Hi guys, I'm trying to login to my github account, in the cloud9 development environment
git config --global user.username <USerNamE>
this code is returning an error message
"bash: syntax error near unexpected token `newline'"
will you be able to help?
Moisés Man
@moigithub
@sigursiguros and <USerNamE> is ur username ??
git config --global user.username sigursiguros
sigursiguros
@sigursiguros
Thanks @moigithub, I added the brackets <> and it wasn't working
CamperBot
@camperbot
sigursiguros sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
sigursiguros
@sigursiguros
appreciate it
CamperBot
@camperbot
:star: 658 | @moigithub | http://www.freecodecamp.com/moigithub
Onwu Gideon
@onwu
wat could be wrong guys
my login page works well on xampp
but when i take it online, it doesn't login again
eeseesee
@eeseesee
@jonslucas I can explain how to set up the google custom search api for the image search project if you are still around/interested
Rafael J. Rodriguez
@Rafase282

Currently streaming with @anders462 about API security at http://www.twitch.tv/freecodecamp

Jon Lucas
@jonslucas
@eeseesee I'm around. I did move on to the Bing API in my implementation, which was extremely simple to setup using something like the node-bing-api module
But, I am also interested in figuring out what I was missing in the cse api
eeseesee
@eeseesee
I spent yesterday figuring it out. You need to start https://cse.google.com and add a search engine. For now, type in anything in the sites to search (e.g. www.google.com). Give it a name you'll recognize later. If you search engine is successful, you'll be on a page with an option to Modify your search engine. Click on the Control Panel button. Under the Basic tab, under Site to Search change the drop down to Search the entire web but emphasize included site. Now you can delete the sites to search that you set when you created the search engine. Toggle allow image search to ON. Save your changes. Now you've basically recreated google search with image search enabled - it will search the entire web and allow you to search images through the api url. On this same page you can get your search engine ID - which you will need for your api url. Copy and paste that to your .env file. Now go to console.developers.google.com and create a new project. In your new project dashboard, click the hamburger menu button and select API Manager. Start by creating credentials. Create an API Key - Browser Key. Copy and paste the key to your .env file because you will need it in your api url. Now for the final step! From the API manager click Overview. Search for the Custom Search Engine API and click enable. That is it. Now you should be able to access your custom search engine using the url https://www.googleapis.com/customsearch/v1?key=GOOGLE_API_KEY&cx=GOOGLE_CSE_ID&q=SEARCH_STRING&searchType=image
I hope I am not leaving any steps out! It is definitely complicated. I was hung up on the final step, enabling the custom search api for hours yesterday.
Rafael J. Rodriguez
@Rafase282
thanks @anders462 for your help
CamperBot
@camperbot
rafase282 sends brownie points to @anders462 :sparkles: :thumbsup: :sparkles:
:star: 333 | @anders462 | http://www.freecodecamp.com/anders462
Anders Bengtsson
@anders462

@Rafase282 localStorage api example

localStorage.setItem('token', 'my token');

localStorage.getItem("token"); /// "my token"

simple as that

Rafael J. Rodriguez
@Rafase282
really? wow
Jon Lucas
@jonslucas
@eeseesee I was soo close. It appears all I was missing was the searchType=image query param
How did you discover that part of it?
I found the docs to be rather unhelpful personally
But perhaps I was looking in the wrong area
eeseesee
@eeseesee
I used a combination of the google documentation and stack overflow responses when things didn't work
Jon Lucas
@jonslucas
Well, I'm glad it was something really minor and not something rather fundamental. Thanks a lot @eeseesee
CamperBot
@camperbot
jonslucas sends brownie points to @eeseesee :sparkles: :thumbsup: :sparkles: