Commit graph

38 commits

Author SHA1 Message Date
Badri Sunderarajan
0d8c6c6adc Make fs read and write operations asynchronous
We're using the Promise/async version of file read/write commands,
so the script doesn't keep blocking or hanging around but can
keep doing other stuff till the file reading or writing is over
2020-05-04 18:18:31 +05:30
Badri Sunderarajan
198f576123 Allow passing local JSON instead of downloading
This way, if you have the JSON already there locally, you don't
have to bother downloading it from online. Especially useful if
the JSON is passed to you some other way, like through a browser
for example
2020-05-04 18:06:01 +05:30
Badri Sunderarajan
0d9ecfd8f5 Make Seance into separate Object
Now, the Seance object is what everyone operates with. That way,
we can do fancy stuff like emitting events, etc. if the need so
arises (as it will, very soon; trust me).
2020-05-04 18:01:05 +05:30
Badri Sunderarajan
e0b5ab31b4 Update mediumexporter 2020-05-04 16:45:23 +05:30
Badri Sunderarajan
299369b363 Bugfix: crashes when no config file detected
It was looking for a (nonexistent, obsolete) variable to check if
the "config" command is running. Now, it just looks at the
command-line options directly and does it.
2020-05-04 13:57:09 +05:30
Hippo
51b7dcf49a Add setup command (to set all config variables) 2020-04-26 21:12:15 +05:30
Hippo
751a647a73 Gracefully fail if Ghost admin not set
This is still ungraceful, in the sense it'll fail spectacularly
later, but at least it gives us the opportunity to run the new
`setup` command first.

Where's that command, you say? Just wait for the next commit! ;-)
2020-04-26 21:11:19 +05:30
Hippo
a57add4809 Allow YAML config load, and escape route if it doesn't exist
The "escape route" is the setup command (yet to be implemented)
2020-04-26 18:38:53 +05:30
Hippo
53b0832a8c Use convict to load config settings 2020-04-24 22:20:18 +05:30
Hippo
fa8b2022ce Add .env to gitignore 2020-04-24 21:29:20 +05:30
Hippo
e41358118a Move config loading to a new file
This is so that we can extend it further (by loading from more
locations, etc.)
2020-04-24 21:28:39 +05:30
Badri Sunderarajan
e1ec23fc3b
Adjust mediumexporter dependency to use seance-latest edition
This is a branch that will be kept updated to work with seance
even if the original at github:xdamman/mediumexporter#master
takes time to pull in changes
2020-01-11 16:40:15 +05:30
Hippo
629549910d Bugfix: double-negative in directory-creation check 2020-01-03 16:04:25 +05:30
Hippo
f402fe6195 Tweak upload functions for more sensible error logging 2020-01-02 14:29:07 +05:30
Hippo
b6a8fe4e63 Upload and set featured image while pushing to Ghost
NOTE: mediumexporter also needs to be updated to download the
feature image in the first place!
2020-01-01 21:37:36 +05:30
Hippo
38b5a8ec5d Medium-to-Ghost processing: Check for title-skipping only once
If we've already skipped the title, no need to go on searching
for it again. We'll probably end up missing some subheadings or
something
2020-01-01 21:36:29 +05:30
Hippo
2131d76fd5 Load metadata in beginning of pushToGhost rather than end
So that we can refer to it in the meantime
2020-01-01 21:35:23 +05:30
Hippo
821111df5e Change upload path month to be 1-indexed instead of 0-indexed
Jan=1 and Dec=12, not Jan=0 and Dec=11. Because that's just too
confusing ;P
2020-01-01 21:33:57 +05:30
Hippo
dd79830afd Replace scissors with section-break and don't upload the image
Some publications, including Snipette, use an image in place of
section breaks. These images should be filtered out for Ghost and
replaced with a linebreak ('---') because the image will be added
later via CSS or something. Also, this means we don't have to
unnecessarily re-upload the pics multiple times and for mulitple
posts
2020-01-01 21:33:31 +05:30
Hippo
9db918b0fa Fix typo in README: content -> create-user 2019-12-24 23:02:17 +05:30
Hippo
69cd1c0c7a Re-enable image uploading for push-ghost
It was disabled while debugging and we left it like that by
mistake :P
2019-12-24 22:52:50 +05:30
Hippo
f6638045d0 Update README with info on new commands and env variables 2019-12-24 22:51:37 +05:30
Hippo
8d6380069f Actually upload the post to Ghost on ghost-push! 2019-12-24 22:38:38 +05:30
Hippo
e01e510ed3 Write authors to metadata
This requires an updated version of mediumexporter, which has
been added in package.json
2019-12-24 22:37:00 +05:30
Hippo
f8da665b5b Set up Ghost Admin interface 2019-12-24 22:22:58 +05:30
Hippo
9ae10df8a3 Add markdown to dependencies 2019-12-24 22:22:21 +05:30
Hippo
9e8da95450 Add Ghost Admin API (@tryghost/admin-api) 2019-12-24 20:52:55 +05:30
Hippo
219a1aa751 Upload profile pic during user creation 2019-12-24 20:30:01 +05:30
Hippo
95f48b24ba Implement "image upload" part of push-ghost command 2019-12-24 14:50:48 +05:30
Hippo
772c9000f8 Convert test WebDAV function into an actual reusable one
Now, if we want to upload something, we know whom to call ;-)
2019-12-24 14:50:13 +05:30
Hippo
2e9db3245f Implement test WebDAV function 2019-12-19 17:50:24 +05:30
Hippo
7f2cbcc221 Rename project: carpe-medium -> Seance
New name suggested by @manasakashi12, since that's what a seance
does: relay messages between Ghost and Medium ;-)
2019-12-10 18:21:43 +05:30
Hippo
770dbb0850 Implement "fetch-medium" function
No processing yet, but at least we get the post and metadata in
a standard format
2019-12-10 18:15:09 +05:30
Hippo
0b45ee2799 Add LICENSE and README 2019-10-11 16:49:33 +05:30
Hippo
56795eed81 Add content directory to .gitignore 2019-10-11 16:29:16 +05:30
Hippo
ccce3dc172 Implement basic fetchFromMedium command 2019-10-11 16:25:52 +05:30
Hippo
bafc64fb5b Implement basic "create-user" functions (outputs JSON) 2019-10-09 16:17:37 +05:30
Hippo
1a6d7a8df3 Initial commit with skeleton CLI tool 2019-10-06 19:27:08 +05:30