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

feat: implement func to get media id from private account post id #336

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mohsensamiei
Copy link

No description provided.

Copy link
Owner

@ahmdrz ahmdrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your interest.


const shortIDLen = 11

func MediaIDFromPrivateID(code string) (string, error) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be great if the original function could handle private IDs too. Move these lines to the original function.

)

func TestMediaIDFromPrivateID(t *testing.T) {
mediaID, err := MediaIDFromPrivateID("CFPU5jqA7F7gtdLtpBevHl5A6rVwt3fi4zVzs00")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, add more tests here to make sure about the function. For example, test invalid codes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants