Skip to content

Commit 1fff029

Browse files
committed
Initial ppu docs
1 parent e490aba commit 1fff029

3 files changed

Lines changed: 477 additions & 0 deletions

File tree

docs.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,17 @@
10121012
]
10131013
}
10141014
]
1015+
},
1016+
{
1017+
"tab": "Pilot",
1018+
"groups": [
1019+
{
1020+
"group": "Pilot",
1021+
"pages": [
1022+
"ppu-pilot"
1023+
]
1024+
}
1025+
]
10151026
}
10161027
]
10171028
}

get-pricing.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Global variable to store pricing data
2+
window.pricingData = {
3+
"eventTypePricing": {
4+
"Post": 0.005,
5+
"User": 0.01
6+
},
7+
"requestTypePricing": {
8+
"Write": 0.01
9+
},
10+
"defaultCost": 0.0
11+
};
12+
13+
// // Fetch pricing data from X console API
14+
// async function fetchPricingData() {
15+
// try {
16+
// const response = await fetch('https://console.x.com/api/credits/pricing', {
17+
// method: 'GET',
18+
// headers: {
19+
// 'dtab-local': '/s/datadelivery-foundation/dev-portal-api:https=>/srv#/staging1/pdxa/datadelivery-foundation/dev-portal-api:https'
20+
// }
21+
// });
22+
23+
// if (!response.ok) {
24+
// throw new Error(`HTTP error! status: ${response.status}`);
25+
// }
26+
27+
// const data = await response.json();
28+
// console.log('Pricing data:', data);
29+
30+
// // Set the global variable
31+
// window.pricingData = data;
32+
33+
// return data;
34+
// } catch (error) {
35+
// console.error('Error fetching pricing data:', error);
36+
// window.pricingData = null;
37+
// }
38+
// }
39+
40+
// Execute the function when the script loads
41+
fetchPricingData();

0 commit comments

Comments
 (0)