Git Product home page Git Product logo

facematch's Introduction

Hi

Here's Facematch, a wrapper for the Facebook Face Recognition feature. I coded it super quickly to recognize my friends when they ring at the door. This is very simple at the moment and there's much to improve (almost no error handlers).

How does it work?

When you upload a picture on Facebook, the /photos/tagging/recognition endpoint is called. This program uploads a private picture (using Facebook API) + calls the recognition endpoint (by simulating a browser using the user's information).

Requirements

Getting Started

I) Install
$ git clone https://github.com/louisondumont/facematch
$ cd facematch
$ npm install
II) Edit config.js

1) Insert your App ID and Secret

2) Go to Facebook, open DevTools > Network.

3) Upload any picture but don't press "Post".

4) Look for the "recognition" endpoint. Network screenshot

5) "Request" > copy-paste the entire "cookie" string in config.js

Cookie screenshot

6) "Form" (raw source) > copy-paste everything from "__user=" in config.js (req_params) Req screenshot

III) Start the server

You can change the http port in config.js

$ node index.js
IV) Get your access token

Navigate to http://localhost:3000/getAccessToken and give access to your Facebook account.

V) Recognize people

POST http://localhost:3000/recognize (accessToken = YOUR_ACCESS_TOKEN, url = YOUR_IMG_URL)

Screenshot query

YAY! Now you can do like Mark and build your intelligent house.

facematch's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

facematch's Issues

Error getting imgUrl and accessToken (undefined:1)

I've located the source of a couple small errors. Lines 11 and 12 in /lib/recognize.js should be

var imgUrl = req.query.url, accessToken = req.query.accessToken;

Also, if you're still have trouble, the problem might be your accessToken. Be sure to allow your facebook app to post for you!

undefined:1 exiting server

Hi,

I love the idea, but I can't get it to work.. I did everything step with no problem but when i'm trying to POST a request, i get this message in my terminal :

undefined:1
SyntaxError: Unexpected end of input
at Object.parse (native)
at Request.cb as _callback
at Request.self.callback (/Users/david/facematch/node_modules/request/request.js:199:22)
at emitTwo (events.js:100:13)
at Request.emit (events.js:185:7)
at Request. (/Users/david/facematch/node_modules/request/request.js:1036:10)
at emitOne (events.js:95:20)
at Request.emit (events.js:182:7)
at IncomingMessage. (/Users/david/facematch/node_modules/request/request.js:963:12)
at emitNone (events.js:85:20)

And I get no response header from POST request with status 0!

Thanks !

Scope "publish_actions" removed from sdk, leaving app completely non-functional

According to the fb developer news at link:

The publish_actions permission will be deprecated. This permission granted apps access to publish posts to Facebook as the logged in user. Apps created from today onwards will not have access to this permission. Apps created before today that have been previously approved to request publish_actions can continue to do so until August 1, 2018. No further apps will be approved to use publish_actions via app review. Developers currently utilizing publish_actions are encouraged to switch to Facebook's Share dialogs for web, iOS and Android.

Thus there seems to be no way to post to facebook, and thus rendering this app non-functional.

Can't find Step 2

Hi there,

Wondering if you can help with some broken links in your instructions.

  1. Go to Facebook, open DevTools > Network.

I cannot find where this is in Facebook. Maybe they changed things, again. Can you point me in right direction?

Large scale app

Could I use this if I intend on making a large scale iOS and Android app?

Can I use Facematch to find user pics from my albums?

Hey. Awesome job. Thanks.

I was wondering if this use-case would be feasible:

  • I have Facebook a page with albums with lots of picture of random people. I also have a website.
  • User X logs in one my website using their own Facebook account.
  • Facematch tries to find user X pictures among the pictures of my Facebook page.

That is probably not possible yet. Doesn't hurt to ask though.

Thanks again.

Any resources for android ?

It's a great job you did here! I want to implement this feature into my Android App, how can I get started!! because I'm a beginner.

Readme

In README, you refer to "Facebook DevTools" when I think you're talking about chrome's.

Empty Results

I've set up everything accordingly to the instructions. When making the POST request after (around) 7000 ms I get returned an empty response. Not sure if Facebook changed the way it handles recognition or I've got something set up wrongly on my end.

'Cannot Get' error when calling recognize function

Hi,

I'm struggling to get this to work. While using the URL below I get the following error:

ERROR:

Cannot GET /recognize%20(accessToken%20=%20EAAYcwd6ZBkLoBAHq7I1MntDH2CXDAPBgq3zjrYZC5RM6z37ZAu8faJjiXn2ZCZAVb9Syw6kauQ92cZB8ZCvtCtiUnHRRy8DGPHuS2ZA7c1mKMlPhQ7ZA0bjbW5LHO7uSrIu0yOdf6FZCbveLiuOxHJUffe7BhIrKLdLR65qfBLUT6P2gZDZD,%20url%20=%20http://local.host/~Brandon/images/1.png)

URL:

http://local.host:3000/recognize (accessToken = EAAYcwd6ZBkLoBAHq7I1MntDH2CXDAPBgq3zjrYZC5RM6z37ZAu8faJjiXn2ZCZAVb9Syw6kauQ92cZB8ZCvtCtiUnHRRy8DGPHuS2ZA7c1mKMlPhQ7ZA0bjbW5LHO7uSrIu0yOdf6FZCbveLiuOxHJUffe7BhIrKLdLR65qfBLUT6P2gZDZD, url = http://local.host/~Brandon/images/1.png)

The url for the image seems to be working fine, and I've tried using different access tokens.

Any help would be greatly appreciated!

Error While Using Access Token and Image URL

Hi,

I'm struggling to get this to work. While using the URL below I get the following error:

ERROR:

Cannot GET /recognize%20(accessToken%20=%20EAAYcwd6ZBkLoBAHq7I1MntDH2CXDAPBgq3zjrYZC5RM6z37ZAu8faJjiXn2ZCZAVb9Syw6kauQ92cZB8ZCvtCtiUnHRRy8DGPHuS2ZA7c1mKMlPhQ7ZA0bjbW5LHO7uSrIu0yOdf6FZCbveLiuOxHJUffe7BhIrKLdLR65qfBLUT6P2gZDZD,%20url%20=%20http://local.host/~Brandon/images/1.png)

URL:

http://local.host:3000/recognize (accessToken = EAAYcwd6ZBkLoBAHq7I1MntDH2CXDAPBgq3zjrYZC5RM6z37ZAu8faJjiXn2ZCZAVb9Syw6kauQ92cZB8ZCvtCtiUnHRRy8DGPHuS2ZA7c1mKMlPhQ7ZA0bjbW5LHO7uSrIu0yOdf6FZCbveLiuOxHJUffe7BhIrKLdLR65qfBLUT6P2gZDZD, url = http://local.host/~Brandon/images/1.png)

The url for the image seems to be working fine, and I've tried using different access tokens but I continue to get the same error.

Any help would be greatly appreciated!

Image URL

I think I have everything set up, but it seems like the image URLs aren't working as after running the server and doing the POST request, I get an error about it being "undefined: 1" [Not Found] and a link back to Facebook. Wondering if I should be putting in the URL to an existing Facebook image or if I can use a local image and it will recognize it (or if this isn't the main problem). Any help or suggestions would be appreciated!

Full error message:

undefined:1
Not Found <br /><a href="http://www.facebook.com/">Back to Facebook.</a>
^

SyntaxError: Unexpected token N
    at Object.parse (native)
    at Request.cb [as _callback] (/Users/Nick/Desktop/facematch/lib/recognize.js:32:23)
    at Request.self.callback (/Users/Nick/Desktop/facematch/node_modules/request/request.js:198:22)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.<anonymous> (/Users/Nick/Desktop/facematch/node_modules/request/request.js:1035:10)
    at emitOne (events.js:82:20)
    at Request.emit (events.js:169:7)
    at IncomingMessage.<anonymous> (/Users/Nick/Desktop/facematch/node_modules/request/request.js:962:12)
    at emitNone (events.js:72:20)

Novice Seeking Assistance! How to use POST?

Hi @louisondumont !

Thank you so much for your work on this project! This is my first time with Node.js, and for the most part Javascript. If you could humor me at your earliest convenience, since the screenshots no longer seem to be live, could you describe how to use the POST line? I have my external image URL and accesstoken from Facebook. Everything else ostensibly seems to be setup correctly. I am just struggling where to enter the line as directed, since I am not having any luck entering the line in the Node.js command prompt, and Git Bash doesn't seem to help either (seriously, big novice!)

Obviously, going to the 'recognize' site also doesn't allow me to enter arguments, and while the index.js is running in Node, the Node terminal doesn't seem to take arguments either (nor would the browser, as it seems).

I am using Windows 10 x64, if it matters.

Thanks!
Sincerely,
Marcus

Error while getting getAccessToken

Hi ,
I hit the below url

http://localhost:3000/getAccessToken

I am getting the below error

Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.

Help me with this

Thanks,
Sarath

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.