domingo, 5 de agosto de 2018

Login on Facebook w/ Jsoup

Hello folks

Today I'll show you how to login in Facebook using the Java library Jsoup.
Jsoup is entirely self-contained and has no dependencies.
Jsoup runs on Java 7 and up, Scala, Kotlin, Android, OSGi, Lambda, and Google App Engine.


Summary:

  1. Creating a blank Java Maven Project
  2. Importing the Jsoup dependency in the pom.xml
  3. Understanding and using the code
  4. Testing

Creating a Java Maven Project


Well, consider using maven in your project, if you don't know about it


Importing the Jsoup dependency in the pom.xml

Jsoup is entirely self-contained and has no dependencies.Jsoup runs on Java 7 and up, Scala, Kotlin, Android, OSGi, Lambda, and Google App Engine. 

You must import the jsoup lib in the your application pom.xml.
Find the last version of Jsoup in the maven repo:


On the date of this posting, the latest version is 1.11.3


Understanding and using the code

I splitted the code in theses classes:

  • FacebookConnect
  • Notification
  • Profile
Unfortunately this blog does not allow anymore code posting, consider get the code in my github
profile, sorry for this inconvenience, if you'll have any question, don't hesitate to ask in comments bellow.

Check out in github, the code was commented and some points are explained:



Your reaction after the code working.