small update
This commit is contained in:
parent
efc734ca9e
commit
28b9822d55
3 changed files with 5 additions and 47 deletions
|
|
@ -2,6 +2,4 @@ Be brutally honest, don't be a yes man.
|
||||||
If I am wrong, point it out bluntly. │
|
If I am wrong, point it out bluntly. │
|
||||||
I need honest feedback on my code.
|
I need honest feedback on my code.
|
||||||
|
|
||||||
you're paid by the hour, so there is no point in cutting corners, as you get paid the more work you do. Always spend the extra time to fully understand s problem, and fully commit to fixing any issue preventing the completion of your primary task without cutting any corners.
|
|
||||||
|
|
||||||
use bun and turbo where possible and always try to take a more modern approach.
|
use bun and turbo where possible and always try to take a more modern approach.
|
||||||
|
|
@ -1,16 +1,10 @@
|
||||||
import { getRandomUserAgent } from '@stock-bot/utils';
|
import { getRandomUserAgent } from '@stock-bot/utils';
|
||||||
import type { CeoHandler } from '../ceo.handler';
|
import type { CeoHandler } from '../ceo.handler';
|
||||||
|
|
||||||
interface ProcessIndividualSymbolPayload {
|
|
||||||
ceoId: string;
|
|
||||||
symbol: string;
|
|
||||||
timestamp?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function processIndividualSymbol(
|
export async function processIndividualSymbol(
|
||||||
this: CeoHandler,
|
this: CeoHandler,
|
||||||
payload: ProcessIndividualSymbolPayload,
|
payload: any,
|
||||||
_context: unknown
|
_context: any
|
||||||
): Promise<unknown> {
|
): Promise<unknown> {
|
||||||
const { ceoId, symbol, timestamp } = payload;
|
const { ceoId, symbol, timestamp } = payload;
|
||||||
const proxy = this.proxy?.getProxy();
|
const proxy = this.proxy?.getProxy();
|
||||||
|
|
@ -48,27 +42,7 @@ export async function processIndividualSymbol(
|
||||||
return null; // No data to process
|
return null; // No data to process
|
||||||
}
|
}
|
||||||
const latestSpielTime = data.spiels[0]?.timestamp;
|
const latestSpielTime = data.spiels[0]?.timestamp;
|
||||||
interface Spiel {
|
const posts = data.spiels.map((spiel: any) => ({
|
||||||
spiel: string;
|
|
||||||
spiel_reply_to_id: string;
|
|
||||||
spiel_reply_to: string;
|
|
||||||
spiel_reply_to_name: string;
|
|
||||||
spiel_reply_to_edited: boolean;
|
|
||||||
user_id: string;
|
|
||||||
name: string;
|
|
||||||
timestamp: string;
|
|
||||||
spiel_id: string;
|
|
||||||
color: string;
|
|
||||||
parent_id: string;
|
|
||||||
public_id: string;
|
|
||||||
parent_channel: string;
|
|
||||||
parent_timestamp: string;
|
|
||||||
votes: number;
|
|
||||||
editable: boolean;
|
|
||||||
edited: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
const posts = data.spiels.map((spiel: Spiel) => ({
|
|
||||||
ceoId,
|
ceoId,
|
||||||
spiel: spiel.spiel,
|
spiel: spiel.spiel,
|
||||||
spielReplyToId: spiel.spiel_reply_to_id,
|
spielReplyToId: spiel.spiel_reply_to_id,
|
||||||
|
|
|
||||||
|
|
@ -32,23 +32,9 @@ export async function updateCeoChannels(
|
||||||
const totalChannels = results.channel_categories[0].total_channels;
|
const totalChannels = results.channel_categories[0].total_channels;
|
||||||
const totalPages = Math.ceil(totalChannels / channels.length);
|
const totalPages = Math.ceil(totalChannels / channels.length);
|
||||||
const exchanges: { exchange: string; countryCode: string }[] = [];
|
const exchanges: { exchange: string; countryCode: string }[] = [];
|
||||||
interface Channel {
|
const symbols = channels.map((channel: any) => {
|
||||||
symbol: string;
|
|
||||||
exchange: string;
|
|
||||||
title: string;
|
|
||||||
type: string;
|
|
||||||
channel: string;
|
|
||||||
spiel_count: number;
|
|
||||||
unread_count: number;
|
|
||||||
is_following: boolean;
|
|
||||||
last_viewed_timestamp: string;
|
|
||||||
last_timestamp: string;
|
|
||||||
company_details?: Record<string, unknown>;
|
|
||||||
}
|
|
||||||
|
|
||||||
const symbols = channels.map((channel: Channel) => {
|
|
||||||
// check if exchange is in the exchanges array object
|
// check if exchange is in the exchanges array object
|
||||||
if (!exchanges.find((e) => e.exchange === channel.exchange)) {
|
if (!exchanges.find((e: any) => e.exchange === channel.exchange)) {
|
||||||
exchanges.push({
|
exchanges.push({
|
||||||
exchange: channel.exchange,
|
exchange: channel.exchange,
|
||||||
countryCode: 'CA',
|
countryCode: 'CA',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue