[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Interesting fact: Instagram keep all of its info inside a single
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 57
Thread images: 5
File: Screenshot_2016-05-03_19-23-27.png (39 KB, 1187x278) Image search: [Google]
Screenshot_2016-05-03_19-23-27.png
39 KB, 1187x278
Interesting fact: Instagram keep all of its info inside a single JSON string and keeps it on the site, and you can easily crawl the site and parse it. I wrote this literally today in Java.
>>
Dully noted
>>
>>54360565
>a single JSON string
Unless they have some serious big data scientists, I doubt it
>>
>>54360565
What does this mean? Can I see pictures of private profiles?
>>
>>54360608
this
>>
File: Screenshot_2016-05-03_19-29-53.png (375 KB, 1440x900) Image search: [Google]
Screenshot_2016-05-03_19-29-53.png
375 KB, 1440x900
>>
>>54360608
It depends on how they handle that request. The common feature is that it checks permissions and your user
>>
File: Screenshot_2016-05-03_19-30-04.png (128 KB, 1440x900) Image search: [Google]
Screenshot_2016-05-03_19-30-04.png
128 KB, 1440x900
>>
>>54360635
>csrf token
RIP in piece OP's anus
>>
>>54360662
Why? I'm not requesting anything lol
>>
>>54360705
csrf tokens is not information that should be publicly available. The feds are on their way
>>
>>54360705
I only do a simple HTTP GET to instagram.com/usernamxxx and read the HTML i get lol
>>
>>54360717
Are you retarded? Do you have any idea how CSRF works?
>>
>>54360729
Do you, faggot?

Although I just glanced and realized there's only 1, so it's probably just OPs
>>
>>54360744
Yes generate random shit, put on HTML, send to client

If the client is valid the same shit will be sent back, if its cross-site it wont. Simple?

Cross Site Request Forgery
>>
>>54360767
I know what the fuck it is lmao. I just explained myself, I saw it once and immediately thought the entire string had a bunch of them
>>
>>54360805
Did you really think i had instagrams pre-generated csrf tokens? lol I only have mine that i got via http get
>>
>>54360822
Screw you mate, I'm tired
>>
cool story ho

>java
Fucking kill yourself.
>>
>>54360565
Yup it's inside a <script> tag - not really sure why they do it. I did a python/Django script to convert instagram username to user_id and other non obvious info
>>
>>54360608
>>54360619
>>54360638

No. If a profile is private it won't return the same JSON information as a public profile. Example you can't get the user_id of a private profile this way.

Also the private profiles have a JSON key of something like is_profile_private that's set to True.
>>
>>54361038
Probably they just make the server spit out a JSON and let JS handle the parsing and loading, to reduce server load perhaps?
>>
>>54360897
Watch out guys!

We have an elite Ganoo/Looniks C programmer here!
>>
>>54361095
Maybe so, I don't know enough about RESTFul APIs to know. I know how to get info from them but I've never written one myself. Might be an easy way to generate content for a page though (reducing the load like you said)

I know when you do infinite scrolling on IG, it does a POST each time to grab 12 new images using the RESTful API, so maybe that's how the initial 12 images are populated as well.
>>
you could've just used bash + jquery for this exact same shit.

also:
>json "string"
>>
jesus christ this board is shit
>>
>>54360565
>>54360565

I'm new to programming but here's a little script I wrote using that <script>JSON response. It just gathers a users's post ID's and like counts into a database, then you can sort to find the most liked photo or whatever

No Instagram API needed ftw

https://github.com/spambusters/instagram-tools/tree/master/likes-counter
>>
>>54360565
>JSON string

>How was copy pasting from stackoverflow?
>>
>>54361211
Why desu?
>>
>>54361211
>>54361225

Because some retard that copy pasted JSON strings together using stackoverflow posts about something that all of us that ever visited instagram dissected on our first visit

>not checking all JS and HTML when u visit a website
>not checking requests to see if they are minified

>Do you even /g/
>>
>>54361212
Nice repos! You spend a lot of time on the tumblr ones i see!
>>54361218
Another smart one! Are you also a mlg Looniks programr?
>>
>>54361211
Your attitude is shit.
>>
>>54361250
>checks all JS and HTML on websites
Oh! You'r a freetard!
>>
so what retard, what can be done with this
>>
>>54361312
not really, i just enjoy checking JS to see how shitty it is for all those huge companies because stackoverflow skids write it
>>
>>54361313
memes
>>
>>54361326
Oh I'm sorry that is actually nice! I don't like JS at all, i dont get it.
>>
>>54361313
>What can be done with JSON data?

If you're a web developer, or just a creative person, you'll figure something out. If you're neither of these things, then maybe this subject isn't for you.

JSON data is extremely useful. Lots of major websites (including 4chan) use the RESTFul API. Every time you check that Auto check for updates on a 4chan thread, you're POSTing JSON.
>>
>>54361370
>RESTFul API
It's RESTful and it isn't really restful at all.
>>
>>54360565
holy shit you're new as fuck
>>
>>54360565
So you mean you just used this - https://www.instagram.com/developer/endpoints/users/ , right ?
Can you crawl over multiple accounts, or do anything remotely interesting with it ?
>>
>>54361478
how dare you
>>
>>54361520
Nah, that way requires the Instagram API.
OP is talking viewing the HTML source of a public Instagram profile - it contains a <script> tag with a dump of JSON data that would normally be retrieved using the Instagram API.

>Can you crawl over multiple accounts

Sure, if you know how to program a basic loop.

>Do anything remotely interesting with it ?

Get creative :)
>>
>>54361555
One can get creative with toilet paper, but the bottom line is (lel, get it ?) it's still something you use to wipe your arse with.
>>
>>54361632
touché
>>
How to get the JSON from instagram account?
>>
>>54362840
install gentoo
>>
>>54361108
Watch out guys!

We have a child with down syndrome here!
>>
I just found if you have the profile ID before being private you can see it even after being set to private.
>>
>>54362929
Interesting. More info?
>>
>>54362840
I used Regex
>>
>>54360565
im having a hard time deciding if i should laugh or cringe...

whats so special about that? the html gets indexed by gateways/proxies/caches and you save one extra request if you had to fetch the html and then the json (given how small the html for a profile page is and the required js files already reside on a cdn).

literally what is so special about this?
>>
>>54360565
congrats on using their API as intended
>>
>>54361108
>>54362870
epic reddit maymays xD
>>
>>54360580
>Dully noted

Do you go to RAHS?
>>
File: image.jpg (46 KB, 600x327) Image search: [Google]
image.jpg
46 KB, 600x327
>>54360565
>instagram
Be interesting elsewhere.
>>
>>54365492
OP is a let haker
Thread replies: 57
Thread images: 5

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.