Giter VIP home page Giter VIP logo

cfc-schedules-tweet's Introduction

Hi there ๐Ÿ‘‹

  • ๐Ÿ”ญ Iโ€™m currently working at @Xendit
  • ๐ŸŒฑ Iโ€™m currently learning toolings and how to make developer's productivity increase ๐Ÿš€
  • ๐Ÿ‘ฏ Iโ€™m looking to collaborate on open source project, go/js/ts language related!
  • โšก Fun fact: KTBFFH!
  • ๐Ÿ“ซ Reach me on twitter

cfc-schedules-tweet's People

Contributors

wildan3105 avatar

Watchers

 avatar  avatar

cfc-schedules-tweet's Issues

Ensure `SERP API` contract is consistent

Is your feature request related to a problem? Please describe.
Sometimes SERP API changes the returned response structure.

Describe the solution you'd like
We need a way to ensure the contract is consistent and if it's not, we need to alert it to mitigate.

Describe alternatives you've considered
Possible alternatives:

  • healthcheck endpoint runs every period
  • service-level testing to cover it

Additional context
Add any other context or screenshots about the feature request here.

Serp API response inconsistency

Describe the bug
Inconsistent result of serp API response. The object of sports_results are sometimes missing from the response body.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Add stadium name in tweet's content

Is your feature request related to a problem? Please describe.
Can't see where is Chelsea playing at.

Describe the solution you'd like
Stadium name.

Describe alternatives you've considered
N/A

Additional context
N/A

Make consumer to be idempotent

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Wrong converted datetime

Describe the bug
Take a look at data stored in redis below:

{
	"tournament": "Premier League",
	"stadium": "Stamford Bridge",
	"date": "Sep 4",
	"time": "8:00 PM",
	"teams": [{
		"name": "Chelsea",
		"thumbnail": "https://serpapi.com/searches/62e5e267aa6c9517ee5ad5e3/images/67d91fa9660009fd8f18601a5e078d6d867ce20a2bc720d250075bafc66db5700d7bc486c80ac592b18558af27e6452f.png"
	}, {
		"name": "West Ham",
		"thumbnail": "https://serpapi.com/searches/62e5e267aa6c9517ee5ad5e3/images/67d91fa9660009fd8f18601a5e078d6d867ce20a2bc720d2352f8c11b8b1bab84d79497af931ee60fd8e632ac14832f4.png"
	}],
	"participants": "@ChelseaFC vs West Ham",
	"date_time": "2022-09-01T13:00:00.000Z"
}

To Reproduce
Sep 4 is somehow converted into Sep 1st

Expected behavior
Date conversion should be Sep 4

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Handle shutdown gracefully

Is your feature request related to a problem? Please describe.
Handle shutdowns in the following:

  • cron (fetcher and reader)
  • worker (match subscriber)

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Remove unused package

pm2 is not used anywhere in this code. it should be removed to reduce the dependencies at run time.

Handle known failures more gracefully

Describe the bug

2024-01-27T04:51:46.247315+00:00 heroku[scheduler.4201]: Starting process with command `node build/jobs/match-reader.js`
2024-01-27T04:51:46.888854+00:00 heroku[scheduler.4201]: State changed from starting to up
2024-01-27T04:51:47.431463+00:00 heroku[scheduler.4201]: Process exited with status 1
2024-01-27T04:51:47.379260+00:00 app[scheduler.4201]: an error occured TypeError: Cannot read property '0' of null
2024-01-27T04:51:47.379309+00:00 app[scheduler.4201]: at /app/build/jobs/match-reader.js:28:47
2024-01-27T04:51:47.379309+00:00 app[scheduler.4201]: at Generator.next (<anonymous>)
2024-01-27T04:51:47.379309+00:00 app[scheduler.4201]: at fulfilled (/app/build/jobs/match-reader.js:5:58)
2024-01-27T04:51:47.379309+00:00 app[scheduler.4201]: at processTicksAndRejections (internal/process/task_queues.js:97:5)

To Reproduce
Steps to reproduce the behavior:

  1. Delete the redis key (fixtures)
  2. Let the match-reader cron runs

Expected behavior
We should handle more gracefully, i.e. only log and send alert/warning/info depending on the error type (retryable/known/unknown/etc.)

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Tournament should be tweeted if stored in redis

Right now, we don't tweet tournament if present. We should handle this. LOC:

header: headerTitle,
teams: `${Emojis.versus} ${message.participants}`,
stadium: `${Emojis.stadium} ${message.stadium}`,
date: `${Emojis.date} ${transformToReadableDate(message.date_time)}`,
time: `${Emojis.time} ${transformToReadableTime(message.date_time)} GMT+7`,
hashtag: `${Team.hashtag}`

Convert `tournament` to hashtag associated to corresponding tournament's tag in twitter

Is your feature request related to a problem? Please describe.
Currently, in #22 tournament would be written in plain text. For example, Premier League will be as it is A.K.A "Premier League". We should transform it to searchable hashtag so that people can easily find it.

Describe the solution you'd like
List of associated hashtag to its corresponding tournament/competition:

  • Premier League -> #PL
  • UEFA Champions League -> #UCL
  • FA Cup -> #FA

and so on

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Fix duplicated tweet

Is your feature request related to a problem? Please describe.
For day-1

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Cannot run serp API healthcheck job

2024-02-09T01:00:34.451428+00:00 heroku[scheduler.8814]: State changed from starting to up
2024-02-09T01:00:34.818203+00:00 app[scheduler.8814]: internal/modules/cjs/loader.js:818
2024-02-09T01:00:34.818281+00:00 app[scheduler.8814]: throw err;
2024-02-09T01:00:34.818281+00:00 app[scheduler.8814]: ^
2024-02-09T01:00:34.818281+00:00 app[scheduler.8814]:
2024-02-09T01:00:34.818282+00:00 app[scheduler.8814]: Error: Cannot find module '/app/builds/jobs/serp-api-healthcheck.js'
2024-02-09T01:00:34.818282+00:00 app[scheduler.8814]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
2024-02-09T01:00:34.818282+00:00 app[scheduler.8814]: at Function.Module._load (internal/modules/cjs/loader.js:667:27)
2024-02-09T01:00:34.818282+00:00 app[scheduler.8814]: at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
2024-02-09T01:00:34.818283+00:00 app[scheduler.8814]: at internal/main/run_main_module.js:17:47 {
2024-02-09T01:00:34.818283+00:00 app[scheduler.8814]: code: 'MODULE_NOT_FOUND',
2024-02-09T01:00:34.818283+00:00 app[scheduler.8814]: requireStack: []
2024-02-09T01:00:34.818284+00:00 app[scheduler.8814]: }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.