メインコンテンツへスキップ

Social::Instagram::Post - Instagram投稿スクレイパー

Social::Instagram::Post

スクレイパーの概要

Social::Instagram::PostSocial::Instagram::Post – はInstagramから投稿をスクレイピングします。投稿タイプ、テキスト、投稿日、コメント数、いいね数など、すべてのデータを自動的に収集します。最大で 1200 件の投稿コメントを 3 分でスクレイピング可能です。コメントのテキストとともに、投稿者のプロフィールリンク、いいね数、作成日時も収集されます。
注記

$video_link を除くすべてのシンプルな結果は、ログインなしで取得可能です。 コメントの収集と $video_link の取得にはログインが必要であり、cookie オプションの値を指定する必要があります。これは以下のスクレイパーと同様です。 Social::Instagram::Profile.

スクレイパーの活用例

投稿下のコメント収集

使用例
  1. ログインに必要なオプション(cookiex-csrftokenx-ig-app-id)の値を指定します。
  2. Page count オプションをオーバーライドし、リストから 100 を選択します。
  3. Result format オプションをオーバーライドし、値として $comments.format('$text\n') を指定します。
  4. クエリとして投稿へのリンクを指定します。
サンプルをダウンロード

A-Parserへのサンプルのインポート方法

eJyNVN1v2jAQ/1+sSl0lROBhe8gbICExsYYV+kRRZSWXzMPxubYDraL87zvnE7p1
6pvv7ve7b1/JHLdHuzFgwVkW7kum6zcLWQIpL6RjI6a5sWC8ec+2GAsuw3ClrOOZ
4XkYbtB6VI8vmXvTQB7wBMaIBMgoEpI1zyDGQnn0icuCMNPJpPqYECMeBQxoxv4H
tibd4RHUJ/Fc61XySWyKJueOOtM0pKPcxJjnoJwdN4Avt53m2cGre3pSt3esOhxG
rKHaZQ3zTD0dt53ujVt+gh36aELCoF6SdM/zOl7CHXhrF+9u7F69B54kwglUXDYR
/KyGqI9KvNT5KiQsPY0AuzSYk8rn2Srfuuz27KaWGbkoau7PhsPClEsLI2Yp1SWn
RJL3FuHAcIcm0j4f0pcM1UzKNZxADrDa/7wQMqHFmqVEWrXEf0Oiv3xUfXmXoWhu
Z0M59F5qaR79GFgJrjHrmiFFLhzJdlHvZcgmpDwC6L5n9x6Wo4E+TOu5jU5/R4Py
SzKMbKYH1VUZV2O5VsaoUpFF7eJ1yELt6INGaoG5luDrUoWUNBYLD8N6zGw7Bi8M
Cb4nL+oQV1/bIUr7fdukqo2g9fvqE8ypk5dRW5cxl/LxYX1pYcNKkfDLOW3DIDif
z2PRnYgxfYpAB4sXO32eq/U2/hYw78tBhrRlVGl16K9Mf4vKD29NWFY0x9920zB8
0R5POuqepSHRXan+AOqBsTk=

収集データ

  • 投稿タイプ
  • テキスト
  • 投稿日
  • コメント数
  • いいね数
  • 画像/動画の幅と高さ
  • 投稿者のプロフィールリンク
  • 投稿者のユーザー名
  • 位置情報
  • いいねに関する情報
  • コメントに関する情報
  • 位置情報へのリンク
  • コメント
    • 投稿者のプロフィールリンク
    • テキスト
    • いいね数
    • 作成日時

ユースケース

  • 投稿に関する情報の収集

クエリ

クエリには、次のように投稿へのリンクを指定する必要があります:

https://www.instagram.com/p/Cqs1_BnLSc6/
https://www.instagram.com/p/CqvaaM5MHVW/

結果出力例

A-Parserは、内蔵のテンプレートエンジン Template Toolkit により、柔軟な結果フォーマットをサポートしています。これにより、任意の形式や、CSV、JSONなどの構造化された形式で結果を出力できます。

デフォルト出力

結果フォーマット:

$query: comments: $comments_count, likes: $likes_count\nText: $text

結果の例:

https://www.instagram.com/p/Cqs1_BnLSc6/: comments: 7268, likes: 362777
Text: “Like anyone else, I get lonely or insecure. Making my art is like creating companions or more well-formed versions of myself. My artworks are like mirrors, but ones where I can manipulate what’s being reflected at me.” —Artist @gitte_maria (Gitte Maria Moller)

Realized across mixed media, including wire frames, 3D sculpture, print plexiglass, panel paintings and site-specific installations, Gitte’s art explores themes in multitude: icons of childhood, 90s computer games, walls, fences and dead ends, pain and joy.

“I draw inspiration across time and history, from the ancient to the contemporary, but I like to think that these things all exist on the same plane and have equal value. Things only have value or importance because we ascribe it, so I like to play around with that, both in the materials I work with and in the content.

I try not to be too goal oriented when I am making work. It’s rather a feeling of something interior that spreads outward. The meaning becomes clearer to me when I’ve had some distance from the reality that generated the artwork. I like to be surprised in this way, so I create a lot of space for chance.”

Art by @gitte_maria

投稿にコメントしたユーザーのプロフィールリンク

結果フォーマット:

$comments.format('$author\n')

結果の例:

https://www.instagram.com/soniyadhawan49/
https://www.instagram.com/meb_ok/
https://www.instagram.com/_shiv_mahakal_0/
https://www.instagram.com/badkonak_miti/
https://www.instagram.com/idarebax9.212.189.baxs.9.999.9/
https://www.instagram.com/_shifa_khan_17_/
https://www.instagram.com/_navid.amiri/
https://www.instagram.com/ariani91___/
https://www.instagram.com/jason.mooreeuc9yg5r1/
https://www.instagram.com/intelligent_girl_231/
https://www.instagram.com/_fasilfiros/
https://www.instagram.com/yonder3r/
https://www.instagram.com/kaminisahu1234/
https://www.instagram.com/violet_organics/
https://www.instagram.com/monic_a9243/

設定可能な項目

パラメータデフォルト値説明
Pages count1コメントをスクレイピングするページ数
cookieログインオプション。コメントをスクレイピングする場合に必須です。
x-csrftokenログインオプション。コメントをスクレイピングする場合に必須です。
x-ig-app-idログインオプション。コメントをスクレイピングする場合に必須です。