Giter Site home page Giter Site logo

Comments (6)

cecobask avatar cecobask commented on August 10, 2024

Hi @thejasonhsu,
Thank you for reporting that issue!
Can you confirm what is the maximum number of objects in the first json file? In other words - at what point subsequent files are being generated for your followers data?

I can update the code to account for that in the coming week, but feel free to open a pull request if you’re interested.

from instagram-insights.

thejasonhsu avatar thejasonhsu commented on August 10, 2024

Np. Won't be submitting PR since I can't fix it via Go haha.

  • followers_1.json ends on line 130002. Take away [], we have 130k. Each account entry makes up 13 lines. So exactly after 10k entries, followers_1.json ends. The 10001st follower will show up as the 1st entry in followers_2.json.
  • Don't need to account for this for following.json because it caps at 7.5k.

from instagram-insights.

cecobask avatar cecobask commented on August 10, 2024

Hi @thejasonhsu,
I've addressed the issue in the latest commit.
I tested this locally with some dummy data - it should work fine for you too.
Could you please sync the latest changes to your fork and confirm whether it works as expected?

from instagram-insights.

thejasonhsu avatar thejasonhsu commented on August 10, 2024

It still only reads the first json.

from instagram-insights.

cecobask avatar cecobask commented on August 10, 2024

The application extracts the zip file that you provide to a folder called instagram_data.
Afterward, it assumes the following structure:

$ tree instagram_data
instagram_data
└── followers_and_following
    ├── followers_1.json
    ├── followers_2.json
    ├── following.json

There can be an infinite number of followers_n.json files in your followers_and_following folder.
Here are the contents of my dummy files:

$ cat instagram_data/followers_and_following/followers_1.json
[
  {
    "title": "",
    "media_list_data": [

    ],
    "string_list_data": [
      {
        "href": "https://www.instagram.com/test1",
        "value": "test1",
        "timestamp": 1664195508
      }
    ]
  }
]
$ cat instagram_data/followers_and_following/followers_2.json
[
  {
    "title": "",
    "media_list_data": [

    ],
    "string_list_data": [
      {
        "href": "https://www.instagram.com/test2",
        "value": "test2",
        "timestamp": 1663444411
      }
    ]
  }
]

The application adds all unique elements from the followers_n.json files to a list and the final result is the following:

  • test1
  • test2

The number of elements in the JSON arrays shouldn't matter because the application will work in the same way regardless of the array sizes.
Let me know if you think the outcome should be different.
It would be helpful if you can confirm the folder structure is the same for you.

from instagram-insights.

thejasonhsu avatar thejasonhsu commented on August 10, 2024

Your assumption and design are correct. I can confirm that my folder structure follows the design.

$ tree instagram_data
instagram_data
└── followers_and_following
    ├── followers_1.json
    ├── followers_2.json
    ├── following.json

Right now it only reads followers_1.json.

  1. First run before e3e301c - failed. Only followers_1.json was used to compare with following.json. Expected results.
  2. Second run before e3e301c - success. The workaround was manually combining followers_1.json with followers_2.json into just followers_1.json. Expected results.
  3. Latest run after e3e301c - failed. Now that the code should combine infinite followers_#.json into followers_n.json, I restored followers_1.json into followers_1.json and followers_2.json. Unexpected results.

My assumption is followers_n.json contains only followers_1.json at the moment. Is there a way to read/debug this file during/after workflow?

from instagram-insights.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.