๐
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mongoose from 'mongoose'; | |
const { Schema } = mongoose; | |
const Listing = new Schema({ | |
"listing_id": { type: Number, index: true, unique: true }, | |
"title": String, | |
"expireAt": { type: Date, expires: 10 } // <========== TTL index here | |
}); | |
export { Listing }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as mineflayer from "mineflayer"; | |
const username = process.env.BOT_USERNAME || 'SAMPLE[bot]'; | |
const host = "127.0.0.1"; | |
const port = process.env.MINECRAFT_SERVER_PORT || 25565; // /publish true adventure 25565 | |
console.log(`chicken bot ${host}:${port}`) | |
const bot = mineflayer.createBot({host, port, username}); | |
// Log errors and kick reasons: | |
bot.on('kicked', console.log) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from : https://github.com/boly38/botEnSky/issues/1 | |
import {BskyAgent} from '@atproto/api' | |
const identifier = process.env.BLUESKY_EMAIL; | |
const password = process.env.BLUESKY_PASSWORD; | |
const service = "https://api.bsky.social"; | |
const agent = new BskyAgent({service}) | |
await agent.login({identifier, password}); | |
const text = "Hey ! Ceci est un Post de PoC (fichier js de 8 lignes) & sera le seul test sur ce compte #bluesky #api #bot https://docs.bsky.app/docs/get-started"; | |
await agent.post({text, createdAt: new Date().toISOString()}).then(console.log).catch(console.log) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from : https://github.com/boly38/botEnSky/issues/15 | |
const logtail_api_token = process.env.LOGTAIL_API_TOKEN; | |
// Source NAME - get it from source config UI : "Basic" > "Source ID" - it's a name not an int | |
const logtail_source_name = process.env.LOGTAIL_SOURCE_NAME; | |
// Source ID - get it from source url, or from results of get sources api - it's an int | |
const logtail_source_id = process.env.LOGTAIL_SOURCE_ID; | |
// Import Axios |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://github.com/boly38/botEnSky/issues/7 | |
// doc : https://docs.bsky.app/docs/tutorials/creating-a-post#images-embeds | |
import axios from "axios"; | |
import {BskyAgent} from '@atproto/api' | |
const identifier = process.env.BLUESKY_EMAIL; | |
const password = process.env.BLUESKY_PASSWORD; | |
const service = "https://api.bsky.social"; | |
const agent = new BskyAgent({service}) | |
await agent.login({identifier, password}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/boly38/botEnSky/issues/26 | |
import {BskyAgent} from '@atproto/api' | |
import dayjs from "dayjs"; | |
import utc from "dayjs/plugin/utc.js" | |
import timezone from "dayjs/plugin/timezone.js" | |
dayjs.extend(utc) | |
dayjs.extend(timezone) | |
/****** lib ******/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for https://github.com/bluesky-social/bsky-docs/issues/152 | |
import process from "node:process"; | |
import {BskyAgent} from '@atproto/api'; | |
const {"BLUESKY_USERNAME": identifier, "BLUESKY_PASSWORD": password} = process.env;// creds from env | |
const agent = new BskyAgent({"service": "https://api.bsky.social"}) | |
await agent.login({identifier, password}); | |
const response = await agent.api.app.bsky.actor.getPreferences(); | |
const {preferences} = response.data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// gist : https://gist.github.com/boly38/5752000289342895a6008e53df2c6c9f | |
// from: https://github.com/boly38/botEnSky/issues/57 | |
// ---------------------------- | |
// ReST API to detect bird - from blog : https://blog.roboflow.com/bird-detection-api/ | |
// API_KEY - REQUIRED - export ROBOFLOW_API_KEY=xxxx | |
// https://app.roboflow.com / use public plan free and get your api key under profile | |
const api_key = process.env["ROBOFLOW_API_KEY"] || "unauthorized"; | |
// bird v2 public dataset based on JS sample provided |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from: https://github.com/boly38/botEnSky/issues/57 | |
// ---------------------------- | |
// ReST API to detect bird - from blog : https://blog.roboflow.com/bird-detection-api/ | |
// *** this file is doing identification of a target folder containing 1..N files having "JPG" as extension | |
import axios from 'axios'; | |
import fs from 'fs'; | |
import path from 'path'; | |
import {fileURLToPath} from 'url'; | |
const __filename = fileURLToPath(import.meta.url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# list them all : [F8] then [2] | |
# alphanum order ASC | |
_hi | |
_gg | |
_gn3 | |
_nice3 | |
aaa | |
aaaa | |
air | |
ban? |