pub const QUERY_HASH: &str = "b3055c01b4b222b8a47dc12b090e4e64";

pub const APP_ID: &str = "936619743392459";

pub mod graphql {
    pub const BASE: &str = "https://www.instagram.com/graphql/query";

    pub mod doc_id {
        // ! changes
        pub const POST_DETAILS: &str = "8845758582119845";
        pub const PROFILE_POSTS: &str = "9310670392322965";
    }

    pub mod query_hash_legacy {
        pub const HIGHLIGHTS: &str = "c9100bf9110dd6361671f113dd02e7d6";
    }

    pub mod query_hash {
        pub const ACCOUNT_MEDIA: &str = "e769aa130647d2354c40ea6a439bfc08";
        pub const TAGGED_MEDIA: &str = "be13233562af2d229b008d2976b998b5";
        pub const FOLLOWING: &str = "c56ee0ae1f89cdbd1c89e2bc6b8f3d18";
        pub const FOLLOWERS: &str = "37479f2b8209594dde7facb0d904896a";
        pub const LIKERS: &str = "e0f59e4a1c8d78d0161873bc2ee7ec44";
        pub const HASHTAG: &str = "ded47faa9a1aaded10161a2ff32abb6b";
        pub const LOCATION: &str = "ac38b90f0f3981c42092016a37c59bf7";
    }
}

pub mod rest {
    pub const PROFILE_INFO: &str = "https://www.instagram.com/api/v1/users/web_profile_info/";
    pub const USER_INFO: &str = "https://i.instagram.com/api/v1/users/{}/info/";
    pub const MEDIA_INFO: &str = "https://www.instagram.com/p/{}/?__a=1&__d=dis";
    pub const SEARCH: &str = "https://www.instagram.com/web/search/topsearch/";
    pub const LOGIN: &str = "https://www.instagram.com/api/v1/web/accounts/login/ajax/";
    pub const LOGOUT: &str = "https://www.instagram.com/api/v1/web/accounts/logout/ajax/";
}

pub mod action {
    pub const LIKE: &str = "https://www.instagram.com/web/likes/{}/like/";
    pub const UNLIKE: &str = "https://www.instagram.com/web/likes/{}/unlike/";
    pub const FOLLOW: &str = "https://www.instagram.com/web/friendships/{}/follow/";
    pub const UNFOLLOW: &str = "https://www.instagram.com/web/friendships/{}/unfollow/";
    pub const COMMENT: &str = "https://www.instagram.com/web/comments/{}/add/";
    pub const DELETE_COMMENT: &str = "https://www.instagram.com/web/comments/{}/delete/{}/";
}

pub fn profile_url(username: &str) -> String {
    format!("{}?username={}", rest::PROFILE_INFO, username)
}

pub fn user_info_url(user_id: &str) -> String {
    rest::USER_INFO.replace("{}", user_id)
}

pub fn media_info_url(shortcode: &str) -> String {
    rest::MEDIA_INFO.replace("{}", shortcode)
}

pub fn like_url(media_id: &str) -> String {
    action::LIKE.replace("{}", media_id)
}

pub fn unlike_url(media_id: &str) -> String {
    action::UNLIKE.replace("{}", media_id)
}

pub fn follow_url(user_id: &str) -> String {
    action::FOLLOW.replace("{}", user_id)
}

pub fn unfollow_url(user_id: &str) -> String {
    action::UNFOLLOW.replace("{}", user_id)
}

pub fn comment_url(media_id: &str) -> String {
    action::COMMENT.replace("{}", media_id)
}
