Skip to content

Instantly share code, notes, and snippets.

@xbladev
Created February 18, 2026 04:35
Show Gist options
  • Select an option

  • Save xbladev/ee7fdfd7b2a1b422abfe2d93a27f42c3 to your computer and use it in GitHub Desktop.

Select an option

Save xbladev/ee7fdfd7b2a1b422abfe2d93a27f42c3 to your computer and use it in GitHub Desktop.
AI SCRAPERS
//Free Scrape Channel
// https://whatsapp.com/channel/0029Vb6xGdD11ulNhYPtMt3j
// WHITECREAM AI SCRAPER and CASE
case "ai2": {
await socket.sendMessage(sender, { react: { text: "✍️", key: msg.key } });
const text = args && args.length > 0 ? args.join(" ") : null;
if (!text) {
await reply1(`Please enter the text. Example: ${prefix}ai2 Hi\n\n${footer}`);
break;
}
const userAgents = [
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36',
'Mozilla/5.0 (iPhone; CPU iPhone OS 17_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2 Mobile/15E148 Safari/604.1',
'Mozilla/5.0 (Linux; Android 14; Pixel 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Mobile Safari/537.36',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
];
async function askWriteCream(userInput) {
const targetApi = 'https://www.writecream.com/wp-admin/admin-ajax.php';
const randomUA = userAgents[Math.floor(Math.random() * userAgents.length)];
const params = new URLSearchParams();
params.append('action', 'generate_chat');
params.append('query', JSON.stringify([
{ "role": "system", "content": "You are a helpful and informative AI assistant." },
{ "role": "user", "content": userInput }
]));
params.append('link', 'writecream.com');
try {
const response = await axios.post(targetApi, params, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'User-Agent': randomUA,
'Origin': 'https://www.writecream.com',
'Referer': 'https://www.writecream.com/ai-chat/',
'X-Requested-With': 'XMLHttpRequest'
}
});
if (response.data && response.data.success) {
return { status: true, result: response.data.data.response_content };
} else {
return { status: false, msg: "WriteCream server rejected the request." };
}
} catch (error) {
return { status: false, msg: error.message };
}
}
try {
const aiResponse = await askWriteCream(text);
if (aiResponse.status) {
await reply1(aiResponse.result);
} else {
await reply1(`❌ AI Error: ${aiResponse.msg}\n\n${footer}`);
}
} catch (e) {
await socket.sendMessage(sender, { text: `❌ Request failed.\n\n${footer}` }, { quoted: msg });
}
}
break;
// ASKAI SCRAPER
async function askFreeAI(userInput) {
const targetApi = 'https://askai.free/api/chat';
const payload = {
messages: [
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: userInput }
],
modelName: "ChatGPT 4o",
currentPagePath: "/chatgpt-4o"
};
try {
const response = await axios.post(targetApi, payload, {
headers: {
'Content-Type': 'application/json',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36',
'Origin': 'https://askai.free',
'Referer': 'https://askai.free/chatgpt-4o',
'Accept': 'application/json, text/plain, */*'
}
});
if (response.data && response.data.response) {
console.log({
status: true,
creator: 'sandarux',
result: response.data.response
});
} else {
console.log({
status: false,
creator: 'sandarux',
msg: "Invalid response from server"
});
}
} catch (error) {
console.log({
status: false,
creator: 'sandarux',
error: error.response ? `Status ${error.response.status}: ${error.message}` : error.message
});
}
}
askFreeAI("good morning");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment