skip to Main Content

Defining which option returned by JSON is greater according to the combination of two data values – Telegram API

In order for me to download an image published on a Telegram channel, I need this path: var contents = JSON.parse(e.postData.contents); Logger.log(contents.channel_post.photo); And the answer is: [{ "file_id":"AAAAA", "file_size":11111, "width":253, "height":320 },{ "file_id":"BBBBB", "file_size":22222, "width":632, "height":800 },{ "file_id":"CCCCC", "file_size":44444, "width":1400,…

VIEW QUESTION

TypeError: Cannot read property 'hasOwnProperty' of undefined – Twitter API V2 vs. GAS

Twitter API: https://developer.twitter.com/en/docs/twitter-api/tweets/timelines/introduction In theory, when there is no data, it should leave the value as empty. As seen in this part of the script: if ( obj_data.data[int_i].entities.hasOwnProperty("urls") && Array.isArray(obj_data.data[int_i].entities.urls) && obj_data.data[int_i].entities.urls[0].expanded_url != undefined ) { array_Expanded_url.push([obj_data.data[int_i].entities.urls[0].expanded_url]); } else {…

VIEW QUESTION
Back To Top
Search