1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Scripts for Instagram

Discussion in 'Other Scripting Languages' started by Alex Benusov, Sep 14, 2016.

  1. Alex Benusov

    Alex Benusov Newbie

    Joined:
    Sep 14, 2016
    Messages:
    3
    Likes Received:
    0
    Gender:
    Male
    Hope it will be useful for someone.

    Instagram Tag Explorer for diggernaut.com

    Code:
    ---
    config:
       agent: Firefox
    iterator:
        - type: csv
          name: tag
          value: scraping
    do:
    - walk:
        to: https://www.instagram.com/explore/tags/<%tag%>/
        do:
        - find:
            path: body
            do:
            - register_set: https://www.instagram.com/p
            - variable_set: baseurl
            - parse:
                filter: window\._sharedData\s+\=\s+([^\n]+);\n
            - normalize:
                routine: json2xml
            - to_block
            - find:
                path: config>csrf_token
                do:
                - parse
                - variable_set: token
            - find:
                path: media>page_info>start_cursor
                do:
                - parse
                - variable_set: cursor
            - walk:
                to:
                    post: https://www.instagram.com/query/
                    headers:
                        x-csrftoken: <%token%>
                        x-instagram-ajax: 1
                        x-requested-with: XMLHttpRequest
                    data:
                        q: 'ig_hashtag(<%tag%>) { media.after("", 100) {
      count,
      nodes {
        caption,
        code,
        comments {
          count
        },
        comments_disabled,
        date,
        dimensions {
          height,
          width
        },
        display_src,
        id,
        is_video,
        likes {
          viewer_has_liked,
          count,
          nodes {
            user {
              id,
              username,
              profile_pic_url
            }
          }
        },
        owner {
          id,
          username,
          full_name,
          biography,
          external_url,
          external_url_linkshimmed,
          requested_by_viewer,
          has_requested_viewer,
          followed_by_viewer,
          follows_viewer,
          blocked_by_viewer,
          has_blocked_viewer,
          is_verified,
          is_private,
          country_block,
          profile_pic_url,
          profile_pic_url_hd,
          follows {
              count
          },
          followed_by {
              count
          },
          media {
              count
          }
        },
        thumbnail_src,
        video_views
      },
      page_info
    }
    }'
                        ref: 'tags::show'
                do:
                - find:
                    path: media>nodes
                    do:
                    - object_new: node
                    - find:
                        path: id
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: id
                    - find:
                        path: caption_safe
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: caption
                    - find:
                        path: code
                        do:
                        - parse
                        - variable_prepend:
                            field: baseurl
                            joinby: "/"
                        - object_field_set:
                            object: node
                            field: url
                    - find:
                        path: is_video
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: is_video
                    - find:
                        path: video_views
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: vide_views
                    - find:
                        path: date
                        do:
                        - parse
                        - normalize:
                            routine: date_format
                            args:
                                format_in: '%s'
                                format_out: '%Y-%m-%d %H:%M:%S'
                        - object_field_set:
                            object: node
                            field: date
                    - find:
                        path: dimensions>width
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: width
                    - find:
                        path: dimensions>height
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: height
                    - find:
                        path: likes>count
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: likes_count
                    - find:
                        path: comments>count
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: comments_count
                    - find:
                        path: comments_disabled
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: comments_disabled
                    - find:
                        path: thumbnail_src
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: thumbnail
                    - find:
                        path: display_src
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: media
                    - find:
                        path: owner>id
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_id
                    - find:
                        path: owner>username
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_username
                    - find:
                        path: owner>full_name
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_full_name
                    - find:
                        path: owner>biography
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_biography
                    - find:
                        path: owner>external_url
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_external_url
                    - find:
                        path: owner>external_url_linkshimmed
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_external_url_linkshimmed
                    - find:
                        path: owner>requested_by_viewer
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_requested_by_viewer
                    - find:
                        path: owner>has_requested_viewer
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_has_requested_viewer
                    - find:
                        path: owner>followed_by_viewer
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_followed_by_viewer
                    - find:
                        path: owner>follows_viewer
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_follows_viewer
                    - find:
                        path: owner>blocked_by_viewer
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_blocked_by_viewer
                    - find:
                        path: owner>has_blocked_viewer
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_has_blocked_viewer
                    - find:
                        path: owner>is_verified
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_is_verified
                    - find:
                        path: owner>is_private
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_is_private
                    - find:
                        path: owner>country_block
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_country_block
                    - find:
                        path: owner>profile_pic_url
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_profile_pic_url
                    - find:
                        path: owner>profile_pic_url_hd
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_profile_pic_url_hd
                    - find:
                        path: owner>follows>count
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_follows_count
                    - find:
                        path: owner>followed_by
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_followed_by_count
                    - find:
                        path: owner>media>count
                        do:
                        - parse
                        - object_field_set:
                            object: node
                            field: owner_media_count
                    - find:
                        path: likes>nodes
                        do:
                        - object_new: likes
                        - find:
                            path: user>id
                            do:
                            - parse
                            - object_field_set:
                                object: likes
                                field: user_id
                        - find:
                            path: user>username
                            do:
                            - parse
                            - object_field_set:
                                object: likes
                                field: username
                        - find:
                            path: user>profile_pic_url
                            do:
                            - parse
                            - object_field_set:
                                object: likes
                                field: user_profile_pic
                        - object_save:
                            name: likes
                            to: node
                    - object_save:
                        name: node
    
    Instagram auto-follower. Follows all followers of given user. Requires instagram account. For diggernaut.com service.
    Code:
    ---
    config:
       agent: Firefox
    iterator:
        - type: csv
          name: user
          value: someusername
    do:
    - walk:
        to: https://www.instagram.com/
        do:
        - find:
            path: body
            do:
            - parse:
                filter: window\._sharedData\s+\=\s+([^;]+);
            - normalize:
                routine: json2xml
            - to_block
            - find:
                path: config>csrf_token
                do:
                - parse
                - variable_set: token
            - walk:
                to:
                    post: https://www.instagram.com/accounts/login/ajax/
                    headers:
                        x-csrftoken: <%token%>
                        x-instagram-ajax: 1
                        x-requested-with: XMLHttpRequest
                    data:
                        username: your_instagram_login
                        password: your_instagram_password
                do:
                - walk:
                    to: https://www.instagram.com/<%user%>/
                    do:
                    - find:
                        path: body
                        do:
                        - parse:
                            filter: window\._sharedData\s+\=\s+([^;]+);
                        - normalize:
                            routine: json2xml
                        - to_block
                        - find:
                            path: config>csrf_token
                            do:
                            - parse
                            - variable_set: token
                        - find:
                            path: user>id
                            do:
                            - parse
                            - variable_set: userid
                        - find:
                            path: user>followed_by>count
                            do:
                            - parse
                            - variable_set: followed_by
                        - walk:
                            to:
                                post: https://www.instagram.com/query/
                                headers:
                                    x-csrftoken: <%token%>
                                    x-instagram-ajax: 1
                                    x-requested-with: XMLHttpRequest
                                data:
                                    q: 'ig_user(<%userid%>) {
      followed_by.first(<%followed_by%>) {
        count,
        page_info {
          end_cursor,
          has_next_page
        },
        nodes {
          id,
          is_verified,
          followed_by_viewer,
          requested_by_viewer,
          full_name,
          profile_pic_url,
          username
        }
      }
    }'
                                    ref: 'relationships::follow_list'
                            do:
                            - find:
                                path: followed_by>nodes
                                do:
                                - find:
                                    path: id
                                    do:
                                    - parse
                                    - variable_set: userid
                                - find:
                                    path: username
                                    do:
                                    - parse
                                    - variable_set: username
                                - find:
                                    path: requested_by_viewer
                                    do:
                                    - parse
                                    - variable_set: requested_by_viewer
                                - find:
                                    path: followed_by_viewer
                                    do:
                                    - parse
                                    - variable_set: followed_by_viewer
                                - variable_get: followed_by_viewer
                                - if:
                                    match: false
                                    do:
                                    - variable_get: requested_by_viewer
                                    - if:
                                        match: false
                                        do:
                                        - walk:
                                            to:
                                                post: https://www.instagram.com/web/friendships/<%userid%>/follow/
                                                headers:
                                                    x-csrftoken: <%token%>
                                                    x-instagram-ajax: 1
                                                    x-requested-with: XMLHttpRequest
                                            data:
                                                t: a
                                            do:
                                            - find:
                                                path: body
                                                do:
                                                - parse
                                                - if:
                                                    match: too many requests
                                                    do:
                                                    - exit
                                                    else:
                                                    - object_new: user
                                                    - variable_get: username
                                                    - object_field_set:
                                                        object: user
                                                        field: username
                                                    - find:
                                                        path: result
                                                        do:
                                                        - parse
                                                        - object_field_set:
                                                            object: user
                                                            field: result
                                                    - object_save:
                                                        name: user
                                                    - sleep: 60
    
    Script to scrape instagram, grabs all user feed data including all followers and follows (requires instagram account). For diggernaut.com service.

    Code:
    ---
    config:
       agent: Firefox
    iterator:
        - type: fieldset
          fields:
          - user: somusername
            itemstoget: 30
            mode: simple
    do:
    - walk:
        to: https://www.instagram.com/
        do:
        - find:
            path: body
            do:
            - parse:
                filter: window\._sharedData\s+\=\s+([^;]+);
            - normalize:
                routine: json2xml
            - to_block
            - find:
                path: config>csrf_token
                do:
                - parse
                - variable_set: token
            - walk:
                to:
                    post: https://www.instagram.com/accounts/login/ajax/
                    headers:
                        x-csrftoken: <%token%>
                        x-instagram-ajax: 1
                        x-requested-with: XMLHttpRequest
                    data:
                        username: your_instagram_username
                        password: your_instagram_password
                do:
                - walk:
                    to: https://www.instagram.com/<%user%>/
                    do:
                    - find:
                        path: body
                        do:
                        - parse:
                            filter: window\._sharedData\s+\=\s+([^;]+);
                        - normalize:
                            routine: json2xml
                        - to_block
                        - find:
                            path: config>csrf_token
                            do:
                            - parse
                            - variable_set: token
                        - find:
                            path: entry_data>profilepage
                            do:
                            - register_set: https://www.instagram.com/p
                            - variable_set: baseurl
                            - object_new: user
                            - find:
                                path: user>id
                                do:
                                - parse
                                - object_field_set:
                                    object: user
                                    field: id
                                - variable_set: userid
                            - find:
                                path: user>username
                                do:
                                - parse
                                - object_field_set:
                                    object: user
                                    field: username
                            - find:
                                path: user>full_name
                                do:
                                - parse
                                - object_field_set:
                                    object: user
                                    field: full_name
                            - find:
                                path: user>biography
                                do:
                                - parse
                                - object_field_set:
                                    object: user
                                    field: biography
                            - find:
                                path: user>profile_pic_url
                                do:
                                - parse
                                - object_field_set:
                                    object: user
                                    field: profile_pic_url
                            - find:
                                path: user>profile_pic_url_hd
                                do:
                                - parse
                                - object_field_set:
                                    object: user
                                    field: profile_pic_url_hd
                            - find:
                                path: user>external_url
                                do:
                                - parse
                                - object_field_set:
                                    object: user
                                    field: external_url
                            - find:
                                path: user>external_url_linkshimmed
                                do:
                                - parse
                                - object_field_set:
                                    object: user
                                    field: external_url_linkshimmed
                            - find:
                                path: user>country_block
                                do:
                                - parse
                                - object_field_set:
                                    object: user
                                    field: country_block
                            - find:
                                path: user>follows>count
                                do:
                                - parse
                                - object_field_set:
                                    object: user
                                    field: follows
                                - variable_set: follows
                            - find:
                                path: user>followed_by>count
                                do:
                                - parse
                                - object_field_set:
                                    object: user
                                    field: followed_by
                                - variable_set: followed_by
                            - find:
                                path: user>media>page_info>start_cursor
                                do:
                                - parse
                                - variable_set: cursor
                            - argument_get: itemstoget
                            - if:
                                match: all
                                do:
                                - find:
                                    path: user>media>count
                                    do:
                                    - parse
                                    - variable_set: items_get
                                else:
                                - variable_set: items_get
                            - walk:
                                to:
                                    post: https://www.instagram.com/query/
                                    headers:
                                        x-csrftoken: <%token%>
                                        x-instagram-ajax: 1
                                        x-requested-with: XMLHttpRequest
                                    data:
                                        q: 'ig_user(<%userid%>) {
      followed_by.first(<%followed_by%>) {
        count,
        page_info {
          end_cursor,
          has_next_page
        },
        nodes {
          id,
          is_verified,
          followed_by_viewer,
          requested_by_viewer,
          full_name,
          profile_pic_url,
          username
        }
      }
    }'
                                        ref: 'relationships::follow_list'
                                do:
                                - find:
                                    path: followed_by>nodes
                                    do:
                                    - object_new: followers
                                    - find:
                                        path: id
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: followers
                                            field: id
                                    - find:
                                        path: username
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: followers
                                            field: username
                                    - find:
                                        path: full_name
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: followers
                                            field: full_name
                                    - find:
                                        path: profile_pic_url
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: followers
                                            field: profile_pic_url
                                    - find:
                                        path: is_verified
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: followers
                                            field: is_verified
                                    - find:
                                        path: followed_by_viewer
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: followers
                                            field: followed_by_viewer
                                    - find:
                                        path: requested_by_viewer
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: followers
                                            field: requested_by_viewer
                                    - object_save:
                                        name: followers
                                        to: user
                            - walk:
                                to:
                                    post: https://www.instagram.com/query/
                                    headers:
                                        x-csrftoken: <%token%>
                                        x-instagram-ajax: 1
                                        x-requested-with: XMLHttpRequest
                                    data:
                                        q: 'ig_user(<%userid%>) {
      follows.first(<%follows%>) {
        count,
        page_info {
          end_cursor,
          has_next_page
        },
        nodes {
          id,
          is_verified,
          followed_by_viewer,
          requested_by_viewer,
          full_name,
          profile_pic_url,
          username
        }
      }
    }'
                                        ref: 'relationships::follow_list'
                                do:
                                - find:
                                    path: follows>nodes
                                    do:
                                    - object_new: following
                                    - find:
                                        path: id
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: following
                                            field: id
                                    - find:
                                        path: username
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: following
                                            field: username
                                    - find:
                                        path: full_name
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: following
                                            field: full_name
                                    - find:
                                        path: profile_pic_url
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: following
                                            field: profile_pic_url
                                    - find:
                                        path: is_verified
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: following
                                            field: is_verified
                                    - find:
                                        path: followed_by_viewer
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: following
                                            field: followed_by_viewer
                                    - find:
                                        path: requested_by_viewer
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: following
                                            field: requested_by_viewer
                                    - object_save:
                                        name: following
                                        to: user
                            - walk:
                                to:
                                    post: https://www.instagram.com/query/
                                    headers:
                                        x-csrftoken: <%token%>
                                        x-instagram-ajax: 1
                                        x-requested-with: XMLHttpRequest
                                    data:
                                        q: 'ig_user(<%userid%>) { media.after(<%cursor%>, <%items_get%>) {
      count,
      nodes {
        caption,
        code,
        comments {
          count
        },
        comments_disabled,
        date,
        dimensions {
          height,
          width
        },
        display_src,
        id,
        is_video,
        likes {
          count
        },
        owner {
          id
        },
        thumbnail_src,
        video_views
      },
      page_info
    }
    }'
                                        ref: 'users::show'
                                do:
                                - find:
                                    path: media>count
                                    do:
                                    - parse
                                    - object_field_set:
                                        object: user
                                        field: media_count
                                - find:
                                    path: media>nodes
                                    do:
                                    - object_new: nodes
                                    - find:
                                        path: id
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: nodes
                                            field: id
                                    - find:
                                        path: is_video
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: nodes
                                            field: is_video
                                    - find:
                                        path: video_views
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: nodes
                                            field: vide_views
                                    - find:
                                        path: date
                                        do:
                                        - parse
                                        - normalize:
                                            routine: date_format
                                            args:
                                                format_in: '%s'
                                                format_out: '%Y-%m-%d %H:%M:%S'
                                        - object_field_set:
                                            object: nodes
                                            field: date
                                    - find:
                                        path: dimensions>width
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: nodes
                                            field: width
                                    - find:
                                        path: dimensions>height
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: nodes
                                            field: height
                                    - find:
                                        path: likes>count
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: nodes
                                            field: likes_count
                                    - find:
                                        path: comments>count
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: nodes
                                            field: comments_count
                                    - find:
                                        path: comments_disabled
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: nodes
                                            field: comments_disabled
                                    - find:
                                        path: caption_safe
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: nodes
                                            field: caption
                                    - find:
                                        path: thumbnail_src
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: nodes
                                            field: thumbnail
                                    - find:
                                        path: display_src
                                        do:
                                        - parse
                                        - object_field_set:
                                            object: nodes
                                            field: media
                                    - find:
                                        path: code
                                        do:
                                        - parse
                                        - variable_prepend:
                                            field: baseurl
                                            joinby: "/"
                                        - object_field_set:
                                            object: nodes
                                            field: url
                                        - variable_set: node_url
                                        - argument_get: mode
                                        - if:
                                            match: extended
                                            do:
                                            - variable_get: node_url
                                            - walk:
                                                to: value
                                                do:
                                                - find:
                                                    path: body
                                                    do:
                                                    - parse:
                                                        filter: window\._sharedData\s+\=\s+([^;]+);
                                                    - normalize:
                                                        routine: json2xml
                                                    - to_block
                                                    - find:
                                                        path: entry_data>postpage>media>comments>nodes
                                                        do:
                                                        - object_new: comments
                                                        - find:
                                                            path: '>id'
                                                            do:
                                                            - parse
                                                            - object_field_set:
                                                                object: comments
                                                                field: id
                                                        - find:
                                                            path: user>id
                                                            do:
                                                            - parse
                                                            - object_field_set:
                                                                object: comments
                                                                field: user_id
                                                        - find:
                                                            path: user>username
                                                            do:
                                                            - parse
                                                            - object_field_set:
                                                                object: comments
                                                                field: username
                                                        - find:
                                                            path: user>profile_pic_url
                                                            do:
                                                            - parse
                                                            - object_field_set:
                                                                object: comments
                                                                field: user_profile_pic
                                                        - find:
                                                            path: text
                                                            do:
                                                            - parse
                                                            - object_field_set:
                                                                object: comments
                                                                field: text
                                                        - find:
                                                            path: created_at
                                                            do:
                                                            - parse:
                                                                filter: (\d+)\.\d+
                                                            - normalize:
                                                                routine: date_format
                                                                args:
                                                                    format_in: '%s'
                                                                    format_out: '%Y-%m-%d %H:%M:%S'
                                                            - object_field_set:
                                                                object: comments
                                                                field: date
                                                        - object_save:
                                                            name: comments
                                                            to: nodes
                                                    - find:
                                                        path: entry_data>postpage>media>likes>nodes
                                                        do:
                                                        - object_new: likes
                                                        - find:
                                                            path: user>id
                                                            do:
                                                            - parse
                                                            - object_field_set:
                                                                object: likes
                                                                field: user_id
                                                        - find:
                                                            path: user>username
                                                            do:
                                                            - parse
                                                            - object_field_set:
                                                                object: likes
                                                                field: username
                                                        - find:
                                                            path: user>profile_pic_url
                                                            do:
                                                            - parse
                                                            - object_field_set:
                                                                object: likes
                                                                field: user_profile_pic
                                                        - object_save:
                                                            name: likes
                                                            to: nodes
                                                    - sleep: 3
                                    - object_save:
                                        name: nodes
                                        to: user
                            - object_save:
                                    name: user
    [/B]
    

    Script for instagram scrape, can be used to get public information from user feed (no login info required). For diggernaut.com service

    Code:
    ---
    config:
       agent: Firefox
    iterator:
        - type: fieldset
          fields:
          - user: somusername
            itemstoget: 30
            mode: simple
    do:
    - walk:
        to: https://www.instagram.com/<%user%>/
        do:
        - find:
            path: body
            do:
            - parse:
                filter: window\._sharedData\s+\=\s+([^;]+);
            - normalize:
                routine: json2xml
            - to_block
            - find:
                path: config>csrf_token
                do:
                - parse
                - variable_set: token
            - find:
                path: entry_data>profilepage
                do:
                - register_set: https://www.instagram.com/p
                - variable_set: baseurl
                - object_new: user
                - find:
                    path: user>id
                    do:
                    - parse
                    - object_field_set:
                        object: user
                        field: id
                    - variable_set: userid
                - find:
                    path: user>username
                    do:
                    - parse
                    - object_field_set:
                        object: user
                        field: username
                - find:
                    path: user>full_name
                    do:
                    - parse
                    - object_field_set:
                        object: user
                        field: full_name
                - find:
                    path: user>biography
                    do:
                    - parse
                    - object_field_set:
                        object: user
                        field: biography
                - find:
                    path: user>profile_pic_url
                    do:
                    - parse
                    - object_field_set:
                        object: user
                        field: profile_pic_url
                - find:
                    path: user>profile_pic_url_hd
                    do:
                    - parse
                    - object_field_set:
                        object: user
                        field: profile_pic_url_hd
                - find:
                    path: user>external_url
                    do:
                    - parse
                    - object_field_set:
                        object: user
                        field: external_url
                - find:
                    path: user>external_url_linkshimmed
                    do:
                    - parse
                    - object_field_set:
                        object: user
                        field: external_url_linkshimmed
                - find:
                    path: user>country_block
                    do:
                    - parse
                    - object_field_set:
                        object: user
                        field: country_block
                - find:
                    path: user>follows>count
                    do:
                    - parse
                    - object_field_set:
                        object: user
                        field: follows
                - find:
                    path: user>followed_by>count
                    do:
                    - parse
                    - object_field_set:
                        object: user
                        field: followed_by
                - find:
                    path: user>media>page_info>start_cursor
                    do:
                    - parse
                    - variable_set: cursor
                - argument_get: itemstoget
                - if:
                    match: all
                    do:
                    - find:
                        path: user>media>count
                        do:
                        - parse
                        - variable_set: items_get
                    else:
                    - variable_set: items_get
                - walk:
                    to:
                        post: https://www.instagram.com/query/
                        headers:
                            x-csrftoken: <%token%>
                            x-instagram-ajax: 1
                            x-requested-with: XMLHttpRequest
                        data:
                            q: 'ig_user(<%userid%>) { media.after(<%cursor%>, <%items_get%>) {
      count,
      nodes {
        caption,
        code,
        comments {
          count
        },
        comments_disabled,
        date,
        dimensions {
          height,
          width
        },
        display_src,
        id,
        is_video,
        likes {
          count
        },
        owner {
          id
        },
        thumbnail_src,
        video_views
      },
      page_info
    }
    }'
                            ref: 'users::show'
                    do:
                    - find:
                        path: media>count
                        do:
                        - parse
                        - object_field_set:
                            object: user
                            field: media_count
                    - find:
                        path: media>nodes
                        do:
                        - object_new: nodes
                        - find:
                            path: id
                            do:
                            - parse
                            - object_field_set:
                                object: nodes
                                field: id
                        - find:
                            path: is_video
                            do:
                            - parse
                            - object_field_set:
                                object: nodes
                                field: is_video
                        - find:
                            path: video_views
                            do:
                            - parse
                            - object_field_set:
                                object: nodes
                                field: vide_views
                        - find:
                            path: date
                            do:
                            - parse
                            - normalize:
                                routine: date_format
                                args:
                                    format_in: '%s'
                                    format_out: '%Y-%m-%d %H:%M:%S'
                            - object_field_set:
                                object: nodes
                                field: date
                        - find:
                            path: dimensions>width
                            do:
                            - parse
                            - object_field_set:
                                object: nodes
                                field: width
                        - find:
                            path: dimensions>height
                            do:
                            - parse
                            - object_field_set:
                                object: nodes
                                field: height
                        - find:
                            path: likes>count
                            do:
                            - parse
                            - object_field_set:
                                object: nodes
                                field: likes_count
                        - find:
                            path: comments>count
                            do:
                            - parse
                            - object_field_set:
                                object: nodes
                                field: comments_count
                        - find:
                            path: comments_disabled
                            do:
                            - parse
                            - object_field_set:
                                object: nodes
                                field: comments_disabled
                        - find:
                            path: caption_safe
                            do:
                            - parse
                            - object_field_set:
                                object: nodes
                                field: caption
                        - find:
                            path: thumbnail_src
                            do:
                            - parse
                            - object_field_set:
                                object: nodes
                                field: thumbnail
                        - find:
                            path: display_src
                            do:
                            - parse
                            - object_field_set:
                                object: nodes
                                field: media
                        - find:
                            path: code
                            do:
                            - parse
                            - variable_prepend:
                                field: baseurl
                                joinby: "/"
                            - object_field_set:
                                object: nodes
                                field: url
                            - variable_set: node_url
                            - argument_get: mode
                            - if:
                                match: extended
                                do:
                                - variable_get: node_url
                                - walk:
                                    to: value
                                    do:
                                    - find:
                                        path: body
                                        do:
                                        - parse:
                                            filter: window\._sharedData\s+\=\s+([^;]+);
                                        - normalize:
                                            routine: json2xml
                                        - to_block
                                        - find:
                                            path: entry_data>postpage>media>comments>nodes
                                            do:
                                            - object_new: comments
                                            - find:
                                                path: '>id'
                                                do:
                                                - parse
                                                - object_field_set:
                                                    object: comments
                                                    field: id
                                            - find:
                                                path: user>id
                                                do:
                                                - parse
                                                - object_field_set:
                                                    object: comments
                                                    field: user_id
                                            - find:
                                                path: user>username
                                                do:
                                                - parse
                                                - object_field_set:
                                                    object: comments
                                                    field: username
                                            - find:
                                                path: user>profile_pic_url
                                                do:
                                                - parse
                                                - object_field_set:
                                                    object: comments
                                                    field: user_profile_pic
                                            - find:
                                                path: text
                                                do:
                                                - parse
                                                - object_field_set:
                                                    object: comments
                                                    field: text
                                            - find:
                                                path: created_at
                                                do:
                                                - parse:
                                                    filter: (\d+)\.\d+
                                                - normalize:
                                                    routine: date_format
                                                    args:
                                                        format_in: '%s'
                                                        format_out: '%Y-%m-%d %H:%M:%S'
                                                - object_field_set:
                                                    object: comments
                                                    field: date
                                            - object_save:
                                                name: comments
                                                to: nodes
                                        - find:
                                            path: entry_data>postpage>media>likes>nodes
                                            do:
                                            - object_new: likes
                                            - find:
                                                path: user>id
                                                do:
                                                - parse
                                                - object_field_set:
                                                    object: likes
                                                    field: user_id
                                            - find:
                                                path: user>username
                                                do:
                                                - parse
                                                - object_field_set:
                                                    object: likes
                                                    field: username
                                            - find:
                                                path: user>profile_pic_url
                                                do:
                                                - parse
                                                - object_field_set:
                                                    object: likes
                                                    field: user_profile_pic
                                            - object_save:
                                                name: likes
                                                to: nodes
                        - object_save:
                            name: nodes
                            to: user
                - object_save:
                        name: user
    [/B]
    
     
  2. love88

    love88 Newbie

    Joined:
    Sep 1, 2016
    Messages:
    9
    Likes Received:
    0
    Gender:
    Male
    Please tell us how to use them
     
  3. Alchemizt

    Alchemizt Regular Member

    Joined:
    Aug 25, 2016
    Messages:
    221
    Likes Received:
    204
    You run them in diggernaut. You need an account there. Looks.like it's free signup. Never used them so dont know if any additional fees.
     
  4. love88

    love88 Newbie

    Joined:
    Sep 1, 2016
    Messages:
    9
    Likes Received:
    0
    Gender:
    Male
    More details Please.
     
  5. Alchemizt

    Alchemizt Regular Member

    Joined:
    Aug 25, 2016
    Messages:
    221
    Likes Received:
    204
    Man it's free. Look that shit up. Use the Google. He gave you the URL for diggernaut. Want us to sign you up and run the scripts for you too ?
     
  6. love88

    love88 Newbie

    Joined:
    Sep 1, 2016
    Messages:
    9
    Likes Received:
    0
    Gender:
    Male
    I've been to the site, but still do not know how to use
     
  7. love88

    love88 Newbie

    Joined:
    Sep 1, 2016
    Messages:
    9
    Likes Received:
    0
    Gender:
    Male
    I ask for your kind reply
     
  8. Alex Benusov

    Alex Benusov Newbie

    Joined:
    Sep 14, 2016
    Messages:
    3
    Likes Received:
    0
    Gender:
    Male
    Go to diggernaut, sing up, create digger, then copy/paste script then edit user or value field in iterator, run, then wait and get u data.