Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Feature request: export publication #31

Merged
merged 1 commit into from
Mar 16, 2022
Merged

Feature request: export publication #31

merged 1 commit into from
Mar 16, 2022

Conversation

miry
Copy link
Owner

@miry miry commented Mar 16, 2022

@clawfire reported:

I would like to export articles from a publication (which has multiple users).

Could be medup -p smileinnovation for example.

@miry miry added the Feature label Mar 6, 2022
@miry miry self-assigned this Mar 6, 2022
@miry
Copy link
Owner

miry commented Mar 6, 2022

Additional information about sample request to scrape publications with medup:

$ medup "https://medium.com/smileinnovation"  
Posts count: 1
GET https://medium.com/smileinnovation?format=json => 200 OK
ERROR: #<KeyError:Missing hash key: "value">
Missing hash key: "value" (KeyError)
  from ???
  from ???
  from ???
  from ???
  from ???

With curl:

curl "https://medium.com/smileinnovation?format=json"                                                                                                                                                                                                                       
])}while(1);</x>{"success":true,"payload":{"collection":{"id":"b27cbdda139c","name":"Smile Innovation","slug":"smileinnovation"

I think user and publications could be parsed.

medup https://medium.com/... # Full url scrape single post or publications
medup @miry    # Detect that it is user with prefix @ and equal https://medium.com/@miry
medup smileinnovation # Equal to https://medium.com/smileinnovation

Explicit params could be also welcome to make sure user expects publications.

@clawfire
Copy link
Author

clawfire commented Mar 7, 2022

That would be awesome, since there's no way to ask an export for a publication from Medium.

miry added a commit that referenced this pull request Mar 16, 2022
Command line accept the `-p <publication slug>` parameter to scrape all articles for that publication.
miry added a commit that referenced this pull request Mar 16, 2022
Command line accept the `-p <publication slug>` parameter to scrape all articles for that publication.
@miry
Copy link
Owner

miry commented Mar 16, 2022

@clawfire If you have time, can you check if it works for you:

$ git checkout 31-publications
$ crystal run src/cli.cr --error-trace -- -p smileinnovation -d posts/smileinnovation

or

$ git checkout 31-publications
$ rake build
$ ./_output/medup -p smileinnovation -d posts/smileinnovation

@clawfire
Copy link
Author

clawfire commented Mar 16, 2022

@clawfire If you have time, can you check if it works for you

It works like a charm 🌟 Thanks a million times!

Command line accept the `-p <publication slug>` parameter to scrape all articles for that publication.
Use crystal lang 1.3.2.
@miry miry merged commit cf4dbfc into master Mar 16, 2022
@miry miry deleted the 31-publications branch March 16, 2022 22:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants