diff --git a/example.php b/example.php
index 9ac352d..e67f730 100644
--- a/example.php
+++ b/example.php
@@ -1,3 +1,35 @@
Login($email, $password);
+ echo "LOGIN RESULT: ".$login_result."\n";
+ }
+}
+
+// Detect if any GET data was received, if so log in to Tadah.
+if(isset($_GET)){
+ if(isset($_GET['email']) && isset($_GET['password'])){
+ $email = $_GET['email'];
+ $password = $_GET['password'];
+ $login = new tadah_federation();
+ $login_result = $login->Login($email, $password);
+ echo "LOGIN RESULT: ".$login_result."\n";
+ }
+}
+
+// Below is an example Form for logging into a Tadah account and returns User info.
+?>
+
Tadah Federation API Example - Login
+
diff --git a/readme.md b/readme.md
index cb3ed74..4f1cbbd 100644
--- a/readme.md
+++ b/readme.md
@@ -16,3 +16,12 @@ Before processing user credentials, the API will fetch a CSRF token by `GET`'ing
Then is `POST`'ed user credentials along with the CSRF token.
# Usage
+Login(username, password) - logs into Tadah and returns the user's info as an `Array`.
+
+# Example
+```
+Login("yourTadahEmail@tadah.rocks", "TadahAccountPassword");
+echo "LOGIN RESULT: ".$login_result;
diff --git a/tadah_federation.php b/tadah_federation.php
index 5a4aa6e..30c2818 100644
--- a/tadah_federation.php
+++ b/tadah_federation.php
@@ -1,9 +1,83 @@
array(
+ '_token' => $matches[1],
+ 'email' => $email,
+ 'password' => $password
+ )
+ ));
+
+ // custom user agent so Tadah staff/server doesn't block us or IP poison us
+ curl_setopt($ch, CURLOPT_USERAGENT, 'cURL/TadahFederation v1 - github.com/PlaceholderLabs/TadahFederation');
+
+ $login_result = curl_exec($ch);
+ /////////////// end of login request ///////////////
+
+
+ /////////////// start of account info fetching ///////////////
+ // Attempt to visit the dashboard, now that we're logged in (this should tell us info like our username, and if we're banned)
+ curl_setopt($ch, CURLOPT_URL, 'https://tadah.rocks/my/dashboard');
+
+ // disable POST, we're not sending any data anymore
+ curl_setopt($ch, CURLOPT_POST, 0);
+
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+
+ // fetch the site's HTML
+ $result = curl_exec($ch);
+ curl_close($ch);
+ /////////////// end of account info fetching ///////////////
+
+
+ // return results
+ return $login_result;
}
}
\ No newline at end of file