mirror of
https://github.com/FranP-code/format_twitter_projects_accounts_tweets.git
synced 2025-10-13 00:32:19 +00:00
Fix CSV parsing and useEffect import errors
This commit is contained in:
committed by
GitHub
parent
b03c2ec0c8
commit
90e62199c5
@@ -1,4 +1,4 @@
|
|||||||
import { useState, useMemo, useRef } from 'react';
|
import { useState, useMemo, useRef, useEffect } from 'react';
|
||||||
import { useVirtualizer } from '@tanstack/react-virtual';
|
import { useVirtualizer } from '@tanstack/react-virtual';
|
||||||
import {
|
import {
|
||||||
createColumnHelper,
|
createColumnHelper,
|
||||||
|
|||||||
@@ -26,7 +26,22 @@ export async function loadTwitterProjects(): Promise<TwitterProject[]> {
|
|||||||
const csvContent = fs.readFileSync(csvPath, 'utf-8');
|
const csvContent = fs.readFileSync(csvPath, 'utf-8');
|
||||||
|
|
||||||
const records = parse(csvContent, {
|
const records = parse(csvContent, {
|
||||||
columns: true,
|
columns: [
|
||||||
|
'id',
|
||||||
|
'created_at',
|
||||||
|
'project_description',
|
||||||
|
'project_url',
|
||||||
|
'media_type',
|
||||||
|
'media_thumbnail',
|
||||||
|
'media_original',
|
||||||
|
'author_screen_name',
|
||||||
|
'author_name',
|
||||||
|
'favorite_count',
|
||||||
|
'retweet_count',
|
||||||
|
'reply_count',
|
||||||
|
'views_count',
|
||||||
|
'original_tweet_url'
|
||||||
|
],
|
||||||
skip_empty_lines: true,
|
skip_empty_lines: true,
|
||||||
cast: (value, context) => {
|
cast: (value, context) => {
|
||||||
// Convert numeric fields
|
// Convert numeric fields
|
||||||
|
|||||||
Reference in New Issue
Block a user