mirror of
https://github.com/cporter202/API-mega-list
synced 2026-04-06 22:16:49 +00:00
moved files to settings folder
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
const https = require('https');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const API_BASE_URL = 'api.apify.com';
|
||||
const AFFILIATE_PARAM = '?fpr=p2hrc6';
|
||||
@@ -136,7 +137,8 @@ async function fetchAllActors(limit = 100) {
|
||||
* Save actors data to JSON file
|
||||
*/
|
||||
function saveToJSON(actors, filename = 'apify_actors.json') {
|
||||
fs.writeFileSync(filename, JSON.stringify(actors, null, 2), 'utf-8');
|
||||
const filePath = path.join(__dirname, '..', filename);
|
||||
fs.writeFileSync(filePath, JSON.stringify(actors, null, 2), 'utf-8');
|
||||
console.log(`Saved ${actors.length} actors to ${filename}`);
|
||||
}
|
||||
|
||||
@@ -213,7 +215,8 @@ function generateMarkdownList(actors, filename = 'APIFY_ACTORS.md') {
|
||||
content += `*Total: ${actors.length} Actors*\n`;
|
||||
content += `*Last updated: ${new Date().toISOString().split('T')[0]} ${new Date().toTimeString().split(' ')[0]}*\n`;
|
||||
|
||||
fs.writeFileSync(filename, content, 'utf-8');
|
||||
const filePath = path.join(__dirname, '..', filename);
|
||||
fs.writeFileSync(filePath, content, 'utf-8');
|
||||
console.log(`Generated markdown list: ${filename}`);
|
||||
}
|
||||
|
||||
@@ -231,7 +234,8 @@ function generateSimpleList(actors, filename = 'apify_actors_simple.txt') {
|
||||
return `${title}|${affiliateUrl}`;
|
||||
});
|
||||
|
||||
fs.writeFileSync(filename, lines.join('\n'), 'utf-8');
|
||||
const filePath = path.join(__dirname, '..', filename);
|
||||
fs.writeFileSync(filePath, lines.join('\n'), 'utf-8');
|
||||
console.log(`Generated simple list: ${filename}`);
|
||||
}
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Read the JSON file
|
||||
const actors = JSON.parse(fs.readFileSync('apify_actors.json', 'utf-8'));
|
||||
// Read the JSON file (look in parent directory)
|
||||
const jsonPath = path.join(__dirname, '..', 'apify_actors.json');
|
||||
const actors = JSON.parse(fs.readFileSync(jsonPath, 'utf-8'));
|
||||
|
||||
console.log(`Processing ${actors.length} actors...`);
|
||||
console.log(`Filtering out test/placeholder actors...`);
|
||||
@@ -377,8 +378,9 @@ content += `**Last Updated: ${new Date().toISOString().split('T')[0]}**\n\n`;
|
||||
content += `*One of the most valuable API lists on GitHub—period.* 💪\n\n`;
|
||||
content += `</div>\n`;
|
||||
|
||||
// Write to README.md
|
||||
fs.writeFileSync('README.md', content, 'utf-8');
|
||||
// Write to README.md (in parent directory)
|
||||
const readmePath = path.join(__dirname, '..', 'README.md');
|
||||
fs.writeFileSync(readmePath, content, 'utf-8');
|
||||
console.log(`✅ Clean README.md generated successfully!`);
|
||||
console.log(` - ${sortedCategories.length} categories`);
|
||||
console.log(` - ${(actors.length - filteredCount).toLocaleString()} total APIs (${filteredCount} filtered out)`);
|
||||
Reference in New Issue
Block a user