Skip to content

Commit fe1e89e

Browse files
authored
Use questions json and run cron (seanprashad#206)
* read data from questions.json * run cron on sunday 5pm pst
1 parent c1e33db commit fe1e89e

File tree

7 files changed

+290
-3314
lines changed

7 files changed

+290
-3314
lines changed

.github/workflows/run-cron.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: run-cron
22

3-
on: workflow_dispatch
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 0'
6+
7+
workflow_dispatch:
48

59
jobs:
610
update:

cron/update_questions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010
'''
1111

12-
questions_file = "questions.json"
12+
questions_file = "../src/data/questions.json"
1313

1414
print("Reading questions file")
1515

package-lock.json

+9-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"react-ga": "^2.7.0",
1818
"react-icons": "^3.11.0",
1919
"react-markdown": "^4.3.1",
20-
"react-scripts": "4.0.0",
20+
"react-scripts": "^4.0.0",
2121
"react-scroll": "^1.8.0",
2222
"react-table": "^7.6.3",
2323
"react-test-renderer": "^16.14.0",

src/components/Table/index.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ const Table = () => {
239239
return (
240240
<NavLink
241241
target="_blank"
242-
href={cellInfo.row.original.url}
242+
href={`https://leetcode.com/problems/${cellInfo.row.original.url}/`}
243243
onClick={() => {
244244
Event(
245245
'Table',
@@ -266,9 +266,7 @@ const Table = () => {
266266
accessor: 'solutions',
267267
disableSortBy: true,
268268
Cell: cellInfo => {
269-
const url = cellInfo.row.original.premium
270-
? `${cellInfo.row.original.url}/`
271-
: cellInfo.row.original.url;
269+
const url = `https://leetcode.com/problems/${cellInfo.row.original.url}/`;
272270
return (
273271
<NavLink
274272
target="_blank"

0 commit comments

Comments
 (0)