- Create Economist SubmissionTracking package correctly: * mainArticle = full blog post content * coverLetter = 216-word SIR— letter * Links to blog post via blogPostId - Archive 'Letter to The Economist' from blog posts (it's the cover letter) - Fix date display on article cards (use published_at) - Target publication already displaying via blue badge Database changes: - Make blogPostId optional in SubmissionTracking model - Economist package ID: 68fa85ae49d4900e7f2ecd83 - Le Monde package ID: 68fa2abd2e6acd5691932150 Next: Enhanced modal with tabs, validation, export 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
60 lines
1.7 KiB
JavaScript
60 lines
1.7 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
const { MongoClient } = require('mongodb');
|
|
require('dotenv').config();
|
|
|
|
const MONGODB_URI = process.env.MONGODB_URI || 'mongodb://localhost:27017/tractatus_dev';
|
|
|
|
async function listImportedArticles() {
|
|
const client = new MongoClient(MONGODB_URI);
|
|
|
|
try {
|
|
await client.connect();
|
|
console.log('✅ Connected to MongoDB\n');
|
|
|
|
const db = client.db();
|
|
const blogPosts = db.collection('blog_posts');
|
|
const submissions = db.collection('submission_tracking');
|
|
|
|
// Find all imported articles
|
|
const articles = await blogPosts
|
|
.find({ tags: 'imported' })
|
|
.sort({ published_at: -1 })
|
|
.toArray();
|
|
|
|
console.log(`Found ${articles.length} imported articles:\n`);
|
|
|
|
for (const article of articles) {
|
|
console.log(`📄 "${article.title}"`);
|
|
console.log(` Slug: ${article.slug}`);
|
|
console.log(` Status: ${article.status}`);
|
|
console.log(` Tags: ${article.tags.join(', ')}`);
|
|
console.log(` URL: http://localhost:9000/blog/${article.slug}`);
|
|
|
|
// Find submission tracking for this article
|
|
const articleSubmissions = await submissions
|
|
.find({ blogPostId: article._id })
|
|
.toArray();
|
|
|
|
if (articleSubmissions.length > 0) {
|
|
console.log(` Submissions:`);
|
|
articleSubmissions.forEach(sub => {
|
|
console.log(` - ${sub.publicationName}: ${sub.status}`);
|
|
});
|
|
} else {
|
|
console.log(` Submissions: None yet`);
|
|
}
|
|
console.log('');
|
|
}
|
|
|
|
await client.close();
|
|
process.exit(0);
|
|
|
|
} catch (error) {
|
|
console.error('Error:', error);
|
|
await client.close();
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
listImportedArticles();
|