Skip to content

Commit

Permalink
ai save
Browse files Browse the repository at this point in the history
  • Loading branch information
1dolinski committed May 16, 2024
1 parent 29e3858 commit 846a61b
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
34 changes: 34 additions & 0 deletions APIs/airstack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import 'dotenv/config'
import { init } from "@airstack/node";
import { fetchQuery } from "@airstack/node";

init(process.env['AIRSTACK_API_KEY']);

const query = `{
FarcasterCasts(
input: {blockchain: ALL, filter: {castedBy: {_eq: "fc_fname:1dolinski"}}}
) {
Cast {
castedAtTimestamp
url
text
numberOfReplies
numberOfRecasts
numberOfLikes
fid
castedBy {
profileName
}
channel {
name
}
}
}
}`;

const variables = {"fc_name":"1dolinski"};

const { data, error } = await fetchQuery(query, variables);


export default data;
4 changes: 4 additions & 0 deletions ai.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import OpenAI from 'openai';
import { promises as fs } from "fs";
import { exec } from "child_process";

import data from "./APIs/airstack.js";

console.log(data);

const openai = new OpenAI({
apiKey: process.env['OPENAI_API_KEY'],
});
Expand Down
26 changes: 26 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@airstack/node": "^0.0.7",
"dotenv": "^16.4.5",
"openai": "^4.47.1"
}
Expand Down

0 comments on commit 846a61b

Please sign in to comment.