Spaces:
Paused
Paused
File size: 5,771 Bytes
17bc126 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Appstate Login Getter Documentation</title>
<script src="https://cdn.tailwindcss.com"></script>
<!-- Include Prism.js for syntax highlighting -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/prism.min.js"></script>
<style>
.fade-in {
animation: fadeIn 1s ease-out;
}
@keyframes fadeIn {
0% {
opacity: 0;
transform: translateY(-30px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
body {
font-family: 'Arial', sans-serif;
}
</style>
</head>
<body class="bg-gray-100 font-sans">
<header class="bg-gray-800 text-white py-6">
<div class="container mx-auto text-center">
<h1 class="text-3xl font-semibold">Appstate Login Getter Documentation</h1>
<p class="text-xl">Created by Jonell Hutchin Magallanes</p>
</div>
</header>
<main class="container mx-auto p-6">
<section class="fade-in">
<h2 class="text-2xl font-semibold text-gray-800 mb-4">Overview</h2>
<p class="text-lg text-gray-700">
This appstate login getter is a simple Node.js application that uses Puppeteer to log into Facebook.
The application takes an email and password as query parameters and returns a JSON response with cookies
and other session data. The app uses Puppeteer for browser automation and logging into Facebook securely.
</p>
</section>
<section class="fade-in mt-8">
<h2 class="text-2xl font-semibold text-gray-800 mb-4">API Endpoints</h2>
<div class="mb-6">
<h3 class="text-xl font-semibold text-gray-800">GET /appstate</h3>
<p class="text-lg text-gray-700">Logs into Facebook with the provided email and password and returns session data (cookies and datr cookie). The response is in JSON format.</p>
<h4 class="text-lg text-gray-700 font-medium mt-4">Request Parameters</h4>
<ul class="list-disc pl-6 text-gray-700">
<li><strong>e</strong>: Email address for Facebook login</li>
<li><strong>p</strong>: Password for Facebook login</li>
</ul>
<h4 class="text-lg text-gray-700 font-medium mt-4">Example Request (Node.js)</h4>
<pre class="bg-gray-800 text-white p-4 rounded-md"><code class="language-javascript">
const axios = require('axios');
// Dynamically fetch the current host
const currentHost = window.location.host;
const apiUrl = `http://${currentHost}/appstate`; // Create the full API URL
axios.get(apiUrl, {
params: {
e: 'your-email@example.com',
p: 'yourpassword'
}
})
.then(response => console.log(response.data))
.catch(error => console.error(error));</code></pre>
<h4 class="text-lg text-gray-700 font-medium mt-4">Example Response</h4>
<pre class="bg-gray-800 text-white p-4 rounded-md"><code class="language-json">
{
"cookies": "cookie1=value1; cookie2=value2",
"jsonCookies": [
{
"domain": ".facebook.com",
"expirationDate": 1673811600,
"hostOnly": false,
"httpOnly": true,
"name": "cookie1",
"path": "/",
"sameSite": "Strict",
"secure": true,
"session": false,
"storeId": "12345",
"value": "value1"
},
{
"domain": ".facebook.com",
"expirationDate": 1673811600,
"hostOnly": false,
"httpOnly": true,
"name": "cookie2",
"path": "/",
"sameSite": "Strict",
"secure": true,
"session": false,
"storeId": "12345",
"value": "value2"
}
],
"datr": "abcdef123456",
"status": "success"
}</code></pre>
</div>
<h4 class="text-xl font-semibold text-gray-800 mt-6">Example Request (Python)</h4>
<pre class="bg-gray-800 text-white p-4 rounded-md"><code class="language-python">
import requests
# Dynamically fetch the current host
current_host = window.location.host
api_url = f"http://{current_host}/appstate"
response = requests.get(api_url, params={'e': 'your-email@example.com', 'p': 'yourpassword'})
print(response.json())</code></pre>
<h4 class="text-xl font-semibold text-gray-800 mt-6">Example Request (PHP)</h4>
<pre class="bg-gray-800 text-white p-4 rounded-md"><code class="language-php">
<?php
$host = $_SERVER['HTTP_HOST'];
$apiUrl = "http://{$host}/appstate";
$response = file_get_contents("{$apiUrl}?e=your-email@example.com&p=yourpassword");
echo $response;
?></code></pre>
<h4 class="text-xl font-semibold text-gray-800 mt-6">Example Request (cURL)</h4>
<pre class="bg-gray-800 text-white p-4 rounded-md"><code class="language-shell">
curl -X GET "http://{currentHost}/appstate?e=your-email@example.com&p=yourpassword"</code></pre>
</section>
<footer class="bg-gray-800 text-white py-4 text-center">
<p>Appstate Login Getter - Created by Jonell Hutchin Magallanes</p>
</footer>
</main>
<script>
// Dynamically fetch the current host for API requests
const currentHost = window.location.host;
const apiUrl = `http://${currentHost}/appstate`;
console.log('Current Host:', currentHost);
console.log('API URL:', apiUrl);
</script>
</body>
</html> |