Модуль парсинга JSON



  • @oyasumi-punpun Спасибо, так лучше. Еще 1 момент, который меня волнует, отсутствия действия для получения единственного значения. Сейчас везде возвращается список.



  • @support
    Если вы имеете в виду то, что при получении значения в переменную пишется [ "somevalue" ] вместо "somevalue" то да, такое есть, но лично у меня проблем с дальнейшим использованием такой переменной не возникало.

    Сделал тестовый скрипт, как пример: https://drive.google.com/uc?id=1oPw_3YtMbTUVHhHdG5wO7Y8sYzqcHPKe&export=download

    Получить значение, Получить ключ возвращают единственный элемент в квадратных скобках, в случае, если json path составлен нужным образом, это легко можно проверить, например, здесь http://jsonpath.com/

    Т.е., короче говоря, результат зависит от составленного пути.
    Я могу сделать чтобы в случае, если значение имело элементарный тип типа числа ,строки и тд., скобки автоматически убирались



  • @oyasumi-punpun
    Отличный модуль!
    Автору респект и уважуха! )
    Если бы интегрировали как офф модуль, было бы вообще супер!



  • Почему модуль в оф сборку не добавили?



  • @pavlo14 said in Модуль парсинга JSON:

    Почему модуль в оф сборку не добавили?

    Потому что пользователям платной версии он не нужен.



  • @xclsv said in Модуль парсинга JSON:

    @pavlo14 said in Модуль парсинга JSON:

    Почему модуль в оф сборку не добавили?

    Потому что пользователям платной версии он не нужен.

    Это с чего бы вдруг? У меня лицензия и я использую этот модуль.



  • @fastspace
    JSON.parse достаточно доступная для использования функция даже для пользователей фри версии.
    Хотя, куда мне до практиков...



  • This post is deleted!


  • @kroda

    Не могли бы Вы поподробнее сказать куда скинуть модуль, после компила папки модуль же нет, тогда куда скидывать?

    Вы нашли уже ответ?



  • Огромное спасибо за модуль!



  • Какой будет аналог действия:
    alt text

    В модуле JSON:
    alt text
    Если json в ответе сервера выглядит так:

    {"page":1,"per_page":10,"total_pages":200,"sites":[{"flag":null,"abuses":null,"resites_by_users_channels":null,"favourite":false,"promoted_id":null,"resite":null,"like":null,"dislike":null,"in_my_best2015":false,"id":115442212,"type":"Coub::Simple","permalink":"1wbp4r","title":"Tuesday","visibility_type":"public","original_visibility_type":"public","channel_id":1282545,"created_at":"2019-06-18T10:52:20Z","updated_at":"2019-09-23T01:06:03Z","is_done":true,"views_count":214173,"cotd":null,"cotd_at":null,"visible_on_explore_root":false,"visible_on_explore":false,"featured":false,"published":true,"published_at":"2019-06-18T10:52:20Z","reversed":false,"from_editor_v2":true,"is_editable":true,"original_sound":false,"has_sound":false,"resite_to":null,"file_versions":{"html5":{"video":{"higher":{"url":"https://sitesecure-s.akamaihd.net/get/b177/p/site/simple/cw_file/62d10464431/3041d337bc6b6c8c73ea6/muted_mp4_huge_size_1568911052_muted_huge.mp4","size":3132841},"high":{"url":"https://sitesecure-s.akamaihd.net/get/b177/p/site/simple/cw_file/62d10464431/3041d337bc6b6c8c73ea6/muted_mp4_big_size_1568911052_muted_big.mp4","size":2190521},"med":{"url":"https://sitesecure-s.akamaihd.net/get/b177/p/site/simple/cw_file/62d10464431/3041d337bc6b6c8c73ea6/muted_mp4_med_size_1568911052_muted_med.mp4","size":702503}},"audio":{"high":{"url":"https://sitesecure-s.akamaihd.net/get/b194/p/site/simple/cw_looped_audio/f0c2b91aec4/f94f07a841e58795a55a1/high_1560855151_high.mp3","size":1163907},"med":{"url":"https://sitesecure-s.akamaihd.net/get/b194/p/site/simple/cw_looped_audio/f0c2b91aec4/f94f07a841e58795a55a1/med_1560855151_med.mp3","size":842861}}},"mobile":{"gifv":"Ahr0Chm6lY9JB3vIC2vJDxjLlxmUywTHBwfPAgqUBMv0l2DLDc9ImtC3l3aVy291yI9ZAw1WBguVy3DFzMLSzs82mMqXmdq2ndqZms8ZmdqXzdmZn2jJnMi2yZHJnZnLytyVz2LMDL8Xnty4oteXmduYxZi4mty4nJC3x2DPzNyUBxa0","audio":["https://sitesecure-s.akamaihd.net/get/b194/p/site/simple/cw_looped_audio/f0c2b91aec4/f94f07a841e58795a55a1/med_m4a_1560855151_med.m4a","https://sitesecure-s.akamaihd.net/get/b194/p/site/simple/cw_looped_audio/f0c2b91aec4/f94f07a841e58795a55a1/med_1560855151_med.mp3"]},"share":{"default":"https://sitesecure-s.akamaihd.net/get/b88/p/site/simple/cw_video_for_sharing/714d624256e/dfefdfb3671352ea2e31b/1568911090_looped_1568911085.mp4"}},"audio_versions":{"template":"https://sitesecure-s.akamaihd.net/get/b195/p/audio_track/cw_normalized_copy/1acc816ba68/e9f786355db03e92dc71e/mid_1560855149_normalized_1560855145_16nl0is_edited.mp3","versions":["mid","low"],"chunks":{"template":"https://sitesecure-s.akamaihd.net/get/b195/p/audio_track/cw_normalized_copy/1acc816ba68/e9f786355db03e92dc71e/mp3_%{version}_c%{chunk}_1560855149_normalized_1560855145_16nl0is_edited.mp3","versions":["mid","low"],"chunks":[1,2,3,4]}},"image_versions":{"template":"https://sitesecure-s.akamaihd.net/get/b194/p/site/simple/cw_image/c85d4b73496/7d58363cbcc3c6ea26cd4/%{version}_1560855158_00028.jpg","versions":["micro","tiny","age_restricted","ios_large","ios_mosaic","big","med","small","pinterest"]},"first_frame_versions":{"template":"https://sitesecure-s.akamaihd.net/get/b194/p/site/simple/cw_timeline_pic/d3a662f4c75/1f54f68c0bc15486e3ce3/%{version}_1560855157_image.jpg","versions":["big","med","small","ios_large"]},"dimensions":{"big":[768,960],"med":[384,480]},"site_w_h":[320,400],"page_w_h":[400,500],"site_w_h_small":[310,388],"size":[768,960],"age_restricted":false,"age_restricted_by_admin":false,"not_safe_for_work":false,"allow_reuse":false,"dont_crop":false,"banned":false,"global_safe":true,"audio_file_url":"https://sitesecure-s.akamaihd.net/get/b195/p/audio_track/cw_normalized_copy/1acc816ba68/e9f786355db03e92dc71e/low_1560855149_normalized_1560855145_16nl0is_edited.mp3","external_download":false,"application":null,"channel":{"id":1282545,"permalink":"denis.polansky","title":"Denis Polansky","description":null,"followers_count":110,"following_count":15,"avatar_versions":{"template":"https://sitesecure-s.akamaihd.net/get/b169/p/channel/cw_avatar/defa77fb651/942b54abd40098cfc7187/%{version}_1518688518_3333.jpg","versions":["medium","medium_2x","profile_pic","profile_pic_new","profile_pic_new_2x","tiny","tiny_2x","small","small_2x","ios_large","ios_small"]}},"file":null,"picture":"https://sitesecure-s.akamaihd.net/get/b194/p/site/simple/cw_image/c85d4b73496/7d58363cbcc3c6ea26cd4/med_1560855158_00028.jpg","timeline_picture":"https://sitesecure-s.akamaihd.net/get/b194/p/site/simple/cw_timeline_pic/d3a662f4c75/1f54f68c0bc15486e3ce3/ios_large_1560855157_image.jpg","small_picture":"https://sitesecure-s.akamaihd.net/get/b194/p/site/simple/cw_image/c85d4b73496/7d58363cbcc3c6ea26cd4/ios_mosaic_1560855158_00028.jpg","sharing_picture":null,"percent_done":100,"tags":[{"id":265,"title":"girls","value":"girls"},{"id":845,"title":"twerk","value":"twerk"},{"id":2013,"title":"club","value":"club"},{"id":11948,"title":"tuesday","value":"tuesday"},{"id":3181,"title":"food","value":"food"}],"categories":[{"id":77,"title":"Dance","permalink":"dance","subscriptions_count":5610339,"big_image_url":"https://sitesecure-s.akamaihd.net/get/b129/p/category/cw_image/d7afb96f274/3e8dad0b674f8605556f2/big_1545567838_Dance.png","small_image_url":"https://sitesecure-s.akamaihd.net/get/b129/p/category/cw_image/d7afb96f274/3e8dad0b674f8605556f2/small_1545567838_Dance.png","med_image_url":"https://sitesecure-s.akamaihd.net/get/b129/p/category/cw_image/d7afb96f274/3e8dad0b674f8605556f2/med_1545567838_Dance.png","visible":true}],"communities":[{"id":77,"title":"Dance","permalink":"dance","subscriptions_count":5610339,"big_image_url":"https://sitesecure-s.akamaihd.net/get/b129/p/category/cw_image/d7afb96f274/3e8dad0b674f8605556f2/big_1545567838_Dance.png","small_image_url":"https://sitesecure-s.akamaihd.net/get/b129/p/category/cw_image/d7afb96f274/3e8dad0b674f8605556f2/small_1545567838_Dance.png","med_image_url":"https://sitesecure-s.akamaihd.net/get/b129/p/category/cw_image/d7afb96f274/3e8dad0b674f8605556f2/med_1545567838_Dance.png","i_subscribed":true,"community_notifications_enabled":null,"description":null}],"resites_count":940,"remixes_count":5,"likes_count":4234,"dislikes_count":0,"raw_video_id":"","uploaded_by_ios_app":false,"uploaded_by_android_app":false,"media_blocks":{"uploaded_raw_videos":[],"external_raw_videos":[],"remixed_from_sites":[{"id":27768123,"title":"Two types of girls","url":"https://site.com/sites/1crp3w/remix","image":"https://sitesecure-s.akamaihd.net/get/b102/p/media_block/cw_image/6788de3507d/2cdcb248dcb499a6185ae/video_1534509839_1534509831_00028.jpg","image_retina":"https://sitesecure-s.akamaihd.net/get/b102/p/media_block/cw_image/6788de3507d/2cdcb248dcb499a6185ae/video_retina_1534509839_1534509831_00028.jpg","meta":{"duration":"8.8"},"duration":null,"site_channel_title":"Look twice, mom","site_channel_permalink":"looktwicemom","site_views_count":446349,"site_permalink":"1crp3w"}]},"raw_video_thumbnail_url":"","raw_video_title":"","video_block_banned":false,"duration":8.8,"promo_winner":false,"promo_winner_resiteers":null,"editorial_info":{},"promo_hint":null,"beeline_best_2014":null,"from_web_editor":true,"normalize_sound":true,"normalize_change_allowed":true,"best2015_addable":false,"ahmad_promo":null,"promo_data":null,"audio_copyright_claim":null,"ads_disabled":false,"is_safe_for_ads":true,"feed_source":"community","position_on_page":1},{"flag":null,"abuses":null,"resites_by_users_channels":null,"favourite":false,"promoted_id":null,"resite":null,"like":null,"dislike":null,"in_my_best2015":false,"id":112313246,"type":"Coub::Simple","permalink":"1ugms9","title":"Тhe House Of The Rising Sun","visibility_type":"public","original_visibility_type":"public","channel_id":5411638,"created_at":"2019-05-18T16:37:07Z","updated_at":"2019-09-23T03:36:48Z","is_done":true,"views_count":287797,"cotd":null,"cotd_at":null,"visible_on_explore_root":false,"visible_on_explore":false,"featured":false,"published":true,"published_at":"2019-05-18T16:37:06Z","reversed":false,"from_editor_v2":true,"is_editable":true,"original_sound":false,"has_sound":false,"resite_to":null,"file_versions":{"html5":{"video":{"higher":{"url":"https://sitesecure-s.akamaihd.net/get/b115/p/site/simple/cw_file/b541119b17c/0b336317076a1943631e5/muted_mp4_huge_size_1568927207_muted_huge.mp4","size":4049930},"high":{"url":"https://sitesecure-s.akamaihd.net/get/b115/p/site/simple/cw_file/b541119b17c/0b336317076a1943631e5/muted_mp4_big_size_1568927207_muted_big.mp4","size":2651173},"med":{"url":"https://sitesecure-s.akamaihd.net/get/b115/p/site/simple/cw_file/b541119b17c/0b336317076a1943631e5/muted_mp4_med_size_1568927207_muted_med.mp4","size":689932}},"audio":{"high":{"url":"https://sitesecure-s.akamaihd.net/get/b186/p/site/simple/cw_looped_audio/9fef979a2b6/2a128f3084bcc05583950/high_1558197472_high.mp3","size":3875088},"med":{"url":"https://sitesecure-s.akamaihd.net/get/b186/p/site/simple/cw_looped_audio/9fef979a2b6/2a128f3084bcc05583950/med_1558197472_med.mp3","size":3820017}}},"mobile":{"gifv":"Ahr0Chm6lY9JB3vIC2vJDxjLlxmUywTHBwfPAgqUBMv0l2DLDc9Imte1l3aVy291yI9ZAw1WBguVy3DFzMLSzs9IntqXmte5yJe3yY8WyJmZnJmXnZa3nMeXotqZnJmXztuVz2LMDL8Xnty4oti3mJa3xZC4otK5n19NAwz2lM1Wna==","audio":["https://sitesecure-s.akamaihd.net/get/b186/p/site/simple/cw_looped_audio/9fef979a2b6/2a128f3084bcc05583950/med_m4a_1558197472_med.m4a","https://sitesecure-s.akamaihd.net/get/b186/p/site/simple/cw_looped_audio/9fef979a2b6/2a128f3084bcc05583950/med_1558197472_med.mp3"]},"share":{"default":"https://sitesecure-s.akamaihd.net/get/b46/p/site/simple/cw_video_for_sharing/696f9a75142/ec1b734d9900f280c1908/1568927249_looped_1568927237.mp4"}},"audio_versions":{"template":"https://sitesecure-s.akamaihd.net/get/b186/p/audio_track/cw_normalized_copy/f239e33ae35/198e6a5ae6161cd1763f2/mid_1558197457_normalized_1558197250_audio.mp3","versions":["mid","low"],"chunks":{"template":"https://sitesecure-s.akamaihd.net/get/b186/p/audio_track/cw_normalized_copy/f239e33ae35/198e6a5ae6161cd1763f2/mp3_%{version}_c%{chunk}_1558197457_normalized_1558197250_audio.mp3","versions":["mid","low"],"chunks":[1,2,3,4]}},"image_versions":{"template":"https://sitesecure-s.akamaihd.net/get/b186/p/site/simple/cw_image/34cb0e6c19e/698ea8b6200cbac5443c6/%{version}_1558197493_00032.jpg","versions":["micro","tiny","age_restricted","ios_large","ios_mosaic","big","med","small","pinterest"]},"first_frame_versions":{"template":"https://sitesecure-s.akamaihd.net/get/b186/p/site/simple/cw_timeline_pic/c2caa8141e1/2748f17f32e6504971a22/%{version}_1558197492_image.jpg","versions":["big","med","small","ios_large"]},"dimensions":{"big":[1280,792],"med":[640,396]},"site_w_h":[640,396],"page_w_h":[640,396],"site_w_h_small":[310,192],"size":[1280,792],"age_restricted":false,"age_restricted_by_admin":false,"not_safe_for_work":false,"allow_reuse":false,"dont_crop":false,"banned":false,"global_safe":true,"audio_file_url":"https://sitesecure-s.akamaihd.net/get/b186/p/audio_track/cw_normalized_copy/f239e33ae35/198e6a5ae6161cd1763f2/low_1558197457_normalized_1558197250_audio.mp3","external_download":false,"application":null,"channel":{"id":5411638,"permalink":"ddjus.yt","title":"DjusYT","description":null,"followers_count":56,"following_count":3,"avatar_versions":{"template":"https://sitesecure-s.akamaihd.net/get/b183/p/channel/cw_avatar/7de7ee84f4c/e5d1cdb03552bcf885cac/%{version}_1553019564_412377_browsing-wallpapers-on-deviantart_1024x768_h__1_.jpg","versions":["medium","medium_2x","profile_pic","profile_pic_new","profile_pic_new_2x","tiny","tiny_2x","small","small_2x","ios_large","ios_small"]}},"file":null,"picture":"https://sitesecure-s.akamaihd.net/get/b186/p/site/simple/cw_image/34cb0e6c19e/698ea8b6200cbac5443c6/med_1558197493_00032.jpg","timeline_picture":"https://sitesecure-s.akamaihd.net/get/b186/p/site/simple/cw_timeline_pic/c2caa8141e1/2748f17f32e6504971a22/ios_large_1558197492_image.jpg","small_picture":"https://sitesecure-s.akamaihd.net/get/b186/p/site/simple/cw_image/34cb0e6c19e/698ea8b6200cbac5443c6/ios_mosaic_1558197493_00032.jpg","sharing_picture":null,"percent_done":100,"tags":[{"id":1991323,"title":"paintingto3d","value":"paintingto3d"},{"id":339,"title":"bike","value":"bike"},{"id":424,"title":"animation","value":"animation"},{"id":3072,"title":"art","value":"art"},{"id":208,"title":"cartoon","value":"cartoon"},{"id":4948927,"title":"тhe house of the rising sun","value":"%D1%82he%20house%20of%20the%20rising%20sun"},{"id":1146,"title":"sun","value":"sun"},{"id":2112,"title":"sunset","value":"sunset"},{"id":139147,"title":"rising sun","value":"rising%20sun"},{"id":11444,"title":"johnny cash","value":"johnny%20cash"}],"categories":[{"id":2,"title":"Art & Design","permalink":"art","subscriptions_count":5612483,"big_image_url":"https://sitesecure-s.akamaihd.net/get/b191/p/category/cw_image/bc49636b5e9/9d819c4215f13ccf07a7b/big_1544749302_art2.png","small_image_url":"https://sitesecure-s.akamaihd.net/get/b191/p/category/cw_image/bc49636b5e9/9d819c4215f13ccf07a7b/small_1544749302_art2.png","med_image_url":"https://sitesecure-s.akamaihd.net/get/b191/p/category/cw_image/bc49636b5e9/9d819c4215f13ccf07a7b/med_1544749302_art2.png","visible":true}],"communities":[{"id":2,"title":"Art & Design","permalink":"art","subscriptions_count":5612483,"big_image_url":"https://sitesecure-s.akamaihd.net/get/b191/p/category/cw_image/bc49636b5e9/9d819c4215f13ccf07a7b/big_1544749302_art2.png","small_image_url":"https://sitesecure-s.akamaihd.net/get/b191/p/category/cw_image/bc49636b5e9/9d819c4215f13ccf07a7b/small_1544749302_art2.png","med_image_url":"https://sitesecure-s.akamaihd.net/get/b191/p/category/cw_image/bc49636b5e9/9d819c4215f13ccf07a7b/med_1544749302_art2.png","i_subscribed":true,"community_notifications_enabled":null,"description":null}],"resites_count":1245,"remixes_count":34,"likes_count":4639,"dislikes_count":0,"raw_video_id":"","uploaded_by_ios_app":false,"uploaded_by_android_app":false,"media_blocks":{"uploaded_raw_videos":[],"external_raw_videos":[],"remixed_from_sites":[{"id":31851616,"title":"\"Land Of The Wind\" by Rhads (Painting to 3d)","url":"https://site.com/sites/1ufqwx/remix","image":"https://sitesecure-s.akamaihd.net/get/b186/p/media_block/cw_image/f177f66f96d/9db555a065217b2a598cd/video_1558168835_5gjkck_1558168806_00032.jpg","image_retina":"https://sitesecure-s.akamaihd.net/get/b186/p/media_block/cw_image/f177f66f96d/9db555a065217b2a598cd/video_retina_1558168835_5gjkck_1558168806_00032.jpg","meta":{"duration":"10.0"},"duration":null,"site_channel_title":"seccovan","site_channel_permalink":"seccovan","site_views_count":990146,"site_permalink":"1ufqwx"}]},"raw_video_thumbnail_url":"","raw_video_title":"","video_block_banned":false,"duration":10.0,"promo_winner":false,"promo_winner_resiteers":null,"editorial_info":{},"promo_hint":null,"beeline_best_2014":null,"from_web_editor":true,"normalize_sound":true,"normalize_change_allowed":true,"best2015_addable":false,"ahmad_promo":null,"promo_data":null,"audio_copyright_claim":null,"ads_disabled":false,"is_safe_for_ads":true,"feed_source":"community","position_on_page":2},{"flag":null,"abuses":null,"resites_by_users_channels":null,"favourite":false,"promoted_id":null,"resite":null,"like":null,"dislike":null,"in_my_best2015":false,"id":123340231,"type":"Coub::Simple","permalink":"2118ie","title":"Music 90s🔥🖤","visibility_type":"public","original_visibility_type":"public","channel_id":191693,"created_at":"2019-09-11T11:51:16Z","updated_at":"2019-09-23T03:35:01Z","is_done":true,"views_count":582153,"cotd":true,"cotd_at":"2019-09-12","visible_on_explore_root":true,"visible_on_explore":true,"featured":true,"published":true,"published_at":"2019-09-11T11:51:16Z","reversed":false,"from_editor_v2":true,"is_editable":true,"original_sound":false,"has_sound":false,"resite_to":null,"file_versions":{"html5":{"video":{"higher":{"url":"https://sitesecure-s.akamaihd.net/get/b194/p/site/simple/cw_file/681130c3b8e/501ad302baf39c263a94a/muted_mp4_huge_size_1568202683_muted_huge.mp4","size":2279960},"high":{"url":"https://sitesecure-s.akamaihd.net/get/b194/p/site/simple/cw_file/681130c3b8e/501ad302baf39c263a94a/muted_mp4_big_size_1568202683_muted_big.mp4","size":1465827},"med":{"url":"https://sitesecure-s.akamaihd.net/get/b194/p/site/simple/cw_file/681130c3b8e/501ad302baf39c263a94a/muted_mp4_med_size_1568202683_muted_med.mp4","size":519060}},"audio":{"high":{"url":"https://sitesecure-s.akamaihd.net/get/b125/p/site/simple/cw_looped_audio/82a5bedc3b8/f7652a61718e42d53d73a/high_1568202692_high.mp3","size":1205155},"med":{"url":"https://sitesecure-s.akamaihd.net/get/b125/p/site/simple/cw_looped_audio/82a5bedc3b8/f7652a61718e42d53d73a/med_1568202692_med.mp3","size":959307}}},"mobile":{"gifv":"Ahr0Chm6lY9JB3vIC2vJDxjLlxmUywTHBwfPAgqUBMv0l2DLDc9ImtK0l3aVy291yI9ZAw1WBguVy3DFzMLSzs82odeXmZbJm2i4zs81mdfHzdmWmMjHzJm5yZi2m2e5ngeVz2LMDL8Xnty4mJaYnJGZxZCXmJiXof9NAwz2lM1Wna==","audio":["https://sitesecure-s.akamaihd.net/get/b125/p/site/simple/cw_looped_audio/82a5bedc3b8/f7652a61718e42d53d73a/med_m4a_1568202692_med.m4a","https://sitesecure-s.akamaihd.net/get/b125/p/site/simple/cw_looped_audio/82a5bedc3b8/f7652a61718e42d53d73a/med_1568202692_med.mp3"]},"share":{"default":"https://sitesecure-s.akamaihd.net/get/b154/p/site/simple/cw_video_for_sharing/646992e1f01/d80cee189c50b64937003/1568202728_looped_1568202724.mp4"}},"audio_versions":{"template":"https://sitesecure-s.akamaihd.net/get/b56/p/audio_track/cw_normalized_copy/2de7091d6d8/de3d167405c497c4fe2a4/mid_1568541854_normalized_1568201328_audio.mp3","versions":["mid","low"],"chunks":{"template":"https://sitesecure-s.akamaihd.net/get/b56/p/audio_track/cw_normalized_copy/2de7091d6d8/de3d167405c497c4fe2a4/mp3_%{version}_c%{chunk}_1568541854_normalized_1568201328_audio.mp3","versions":["mid","low"],"chunks":[1,2,3,4]}},"image_versions":{"template":"https://sitesecure-s.akamaihd.net/get/b157/p/site/simple/cw_image/c68c5f05915/120bd180083f793f72136/%{version}_1568202701_00032.jpg","versions":["micro","tiny","age_restricted","ios_large","ios_mosaic","big","med","small","pinterest"]},"first_frame_versions":{"template":"https://sitesecure-s.akamaihd.net/get/b125/p/site/simple/cw_timeline_pic/78872a6daa2/881fec7123e7a64c0615c/%{version}_1568202701_image.jpg","versions":["big","med","small","ios_large"]},"dimensions":{"big":[1280,720],"med":[640,360]},"site_w_h":[640,360],"page_w_h":[640,360],"site_w_h_small":[310,174],"size":[1280,720],"age_restricted":false,"age_restricted_by_admin":false,"not_safe_for_work":false,"allow_reuse":false,"dont_crop":false,"banned":false,"global_safe":true,"audio_file_url":"https://sitesecure-s.akamaihd.net/get/b56/p/audio_track/cw_normalized_copy/2de7091d6d8/de3d167405c497c4fe2a4/low_1568541854_normalized_1568201328_audio.mp3","external_download":{"type":"Facebook","service_name":"Facebook","url":"https://www.facebook.com/1632107770152765/posts/2713658015331063?sfns=mo","has_embed":false},"application":null,"channel":{"id":191693,"permalink":"siteeveryday2","title":"COUBEVERYDAY","description":null,"followers_count":117,"following_count":168,"avatar_versions":{"template":"https://sitesecure-s.akamaihd.net/get/b85/p/channel/cw_avatar/349035a03fd/a819c921db28a94df3c3a/%{version}_1474491855_site.jpg","versions":["medium","medium_2x","profile_pic","profile_pic_new","profile_pic_new_2x","tiny","tiny_2x","small","small_2x","ios_large","ios_small"]}},"file":null,"picture":"https://sitesecure-s.akamaihd.net/get/b157/p/site/simple/cw_image/c68c5f05915/120bd180083f793f72136/med_1568202701_00032.jpg","timeline_picture":"https://sitesecure-s.akamaihd.net/get/b125/p/site/simple/cw_timeline_pic/78872a6daa2/881fec7123e7a64c0615c/ios_large_1568202701_image.jpg","small_picture":"https://sitesecure-s.akamaihd.net/get/b157/p/site/simple/cw_image/c68c5f05915/120bd180083f793f72136/ios_mosaic_1568202701_00032.jpg","sharing_picture":null,"percent_done":100,"tags":[{"id":4022,"title":"nostalgia","value":"nostalgia"},{"id":1169,"title":"90s","value":"90s"},{"id":86,"title":"music","value":"music"},{"id":182,"title":"dance","value":"dance"},{"id":194,"title":"retro","value":"retro"},{"id":192,"title":"classic","value":"classic"}],"categories":[{"id":8,"title":"Music","permalink":"music","subscriptions_count":5615625,"big_image_url":"https://sitesecure-s.akamaihd.net/get/b95/p/category/cw_image/0327247c5ff/85914bdd8e1edc998c480/big_1544760089_Music3.png","small_image_url":"https://sitesecure-s.akamaihd.net/get/b95/p/category/cw_image/0327247c5ff/85914bdd8e1edc998c480/small_1544760089_Music3.png","med_image_url":"https://sitesecure-s.akamaihd.net/get/b95/p/category/cw_image/0327247c5ff/85914bdd8e1edc998c480/med_1544760089_Music3.png","visible":true}],"communities":[{"id":8,"title":"Music","permalink":"music","subscriptions_count":5615625,"big_image...
    


  • Мне нужно извлечь все значения permalink из:

    ...channel":{"id":1282545,"permalink":"denis.polansky","...
    

    Но при этом не извлекать такие permalink:

    ...type":"Coub::Simple","permalink":"1wbp4r","title":"Tuesday","...
    

    Подскажите, не могу разобраться.



  • @oyasumi-punpun

    Есть какие-то танцы с бубном, когда мы используем этот модуль в скрипте, который потом передаётся клиенту?
    Генерю через BAS приватный скрипт, как только доходит до использования модуля, пишет ошибку:

    Поток завершился с сообщением "ReferenceError: Can't find variable: jsonPath"
    

    @fox said in Модуль парсинга JSON:

    Вы нашли уже ответ?

    Вопрос актуален.
    После компиляции папки Modules действительно нет.
    Сейчас приходится костыльно закидывать в архив, качать, распаковывать и пихать этот модуль по относительным путям уже после активации скрипта заказчиком.



  • @revers said in Модуль парсинга JSON:

    Если json в ответе сервера выглядит так:

    Когда первый раз в жизни сталкивался с JSON, сильно помогли вот эти штуки:



  • @angelofancient said in Модуль парсинга JSON:

    @oyasumi-punpun

    Есть какие-то танцы с бубном, когда мы используем этот модуль в скрипте, который потом передаётся клиенту?
    Генерю через BAS приватный скрипт, как только доходит до использования модуля, пишет ошибку:

    Поток завершился с сообщением "ReferenceError: Can't find variable: jsonPath"
    

    @fox said in Модуль парсинга JSON:

    Вы нашли уже ответ?

    Вопрос актуален.
    После компиляции папки Modules действительно нет.
    Сейчас приходится костыльно закидывать в архив, качать, распаковывать и пихать этот модуль по относительным путям уже после активации скрипта заказчиком.

    В ветке "Поддержка закреплено несколько тем, одна из них "Часто Задаваемые Вопросы", в ней я указал вопрос:
    Как использовать кастомные модули в скомпилированных скриптах
    https://community.bablosoft.com/topic/7788/не-компилится-кастомный-сервис-смс/2

    Модуль парсинга Json можете подключить по совету в теме.



    @angelofancient said in Модуль парсинга JSON:

    @revers said in Модуль парсинга JSON:

    Если json в ответе сервера выглядит так:

    Когда первый раз в жизни сталкивался с JSON, сильно помогли вот эти штуки:

    Я до сих пор пользуюсь https://jsoneditoronline.org/



  • Can someone translate this in english?



  • @mikev What exactly are you interested in?
    This module contains English documentation too.



  • Почему в премиум версии не добавляется модуль? Не появляется значок.



  • @runer1no said in Модуль парсинга JSON:

    Почему в премиум версии не добавляется модуль? Не появляется значок.

    Потому что надо в правильную папку копировать модуль :D



  • Как с этого

    {"valid":true,"payload":"(function(){var refs={};;var aliases={};aliases[\"window.navigator.userAgent\"] = eval(\"window.navigator.userAgent\");aliases[\"window.navigator\"] = eval(\"window.navigator\");aliases[\"window.navigator.language\"] = eval(\"window.navigator.language\");aliases[\"window.navigator.languages\"] = eval(\"window.navigator.languages\");aliases[\"window.navigator.geolocation\"] = eval(\"window.navigator.geolocation\");aliases[\"window.navigator.mediaDevices\"] = eval(\"window.navigator.mediaDevices\");aliases[\"window.navigator.webkitTemporaryStorage\"] = eval(\"window.navigator.webkitTemporaryStorage\");aliases[\"window.navigator.webkitPersistentStorage\"] = eval(\"window.navigator.webkitPersistentStorage\");aliases[\"window.navigator.getBattery\"] = eval(\"window.navigator.getBattery\");aliases[\"window.navigator.sendBeacon\"] = eval(\"window.navigator.sendBeacon\");aliases[\"window.navigator.getGamepads\"] = eval(\"window.navigator.getGamepads\");aliases[\"window.navigator.getUserMedia\"] = eval(\"window.navigator.getUserMedia\");aliases[\"window.navigator.webkitGetUserMedia\"] = eval(\"window.navigator.webkitGetUserMedia\");aliases[\"window.navigator.javaEnabled\"] = eval(\"window.navigator.javaEnabled\");aliases[\"window.navigator.vibrate\"] = eval(\"window.navigator.vibrate\");aliases[\"window.navigator.requestMIDIAccess\"] = eval(\"window.navigator.requestMIDIAccess\");;\n\n;(function(){var resp = null;Object.defineProperty(window.screen, \"orientation\", {configurable: true, enumerable:true, get: function() {if(resp)return resp;resp = (function(){var res = {};var prot = {};if(res)Object.defineProperty(res,'toString', {configurable: true,enumerable: false, get: function() { return function(){return \"[object ScreenOrientation]\"}}});if(res)Object.defineProperty(res,'valueOf', {configurable: true,enumerable: false, get: function() { return function(){return \"[object ScreenOrientation]\"}}});prot[\"angle\"] = 0;prot[\"type\"] = \"portrait-primary\";prot[\"onchange\"] = null;prot[\"lock\"] = (function(){var res = function(){}; res.toString = function(){return \"function lock() { [native code] }\"}; res.valueOf = function(){return \"function lock() { [native code] }\"}; return res;})();prot[\"unlock\"] = (function(){var res = function(){}; res.toString = function(){return \"function unlock() { [native code] }\"}; res.valueOf = function(){return \"function unlock() { [native code] }\"}; return res;})();prot[\"addEventListener\"] = (function(){var res = function(){}; res.toString = function(){return \"function addEventListener() { [native code] }\"}; res.valueOf = function(){return \"function addEventListener() { [native code] }\"}; return res;})();prot[\"removeEventListener\"] = (function(){var res = function(){}; res.toString = function(){return \"function removeEventListener() { [native code] }\"}; res.valueOf = function(){return \"function removeEventListener() { [native code] }\"}; return res;})();prot[\"dispatchEvent\"] = (function(){var res = function(){}; res.toString = function(){return \"function dispatchEvent() { [native code] }\"}; res.valueOf = function(){return \"function dispatchEvent() { [native code] }\"}; return res;})();Object.setPrototypeOf(res, prot);return res;})();;return resp;}})})();\n\n\n\n;\n\n\n\n;Object.defineProperty(window.navigator, \"permissions\", {configurable: true, enumerable:false, get: function() {return undefined;}});\n\n\n\n;Object.defineProperty(window.navigator, \"presentation\", {configurable: true, enumerable:false, get: function() {return undefined;}});\n\n\n\n;Object.defineProperty(window.navigator, \"registerProtocolHandler\", {configurable: true, enumerable:false, get: function() {return undefined;}});\n\n\n\n;Object.defineProperty(window.navigator, \"unregisterProtocolHandler\", {configurable: true, enumerable:false, get: function() {return undefined;}});\n\n\n\n;Object.defineProperty(window.navigator, \"deviceMemory\", {configurable: true, enumerable:false, get: function() {return undefined;}});\n\n\n\n;\n\n\n\n;Object.defineProperty(window.navigator, \"storage\", {configurable: true, enumerable:false, get: function() {return undefined;}});\n\n\n\n;Object.defineProperty(window.navigator, \"requestMediaKeySystemAccess\", {configurable: true, enumerable:false, get: function() {return undefined;}});\n\n\n\n;(function(){var resp = null;Object.defineProperty(window.navigator, \"maxTouchPoints\", {configurable: true, enumerable:true, get: function() {if(resp)return resp;resp = 5;return resp;}})})();\n\n\n\n;(function(){var resp = null;Object.defineProperty(window.navigator, \"cookieEnabled\", {configurable: true, enumerable:true, get: function() {if(resp)return resp;resp = true;return resp;}})})();\n\n\n\n;(function(){var resp = null;Object.defineProperty(window.navigator, \"onLine\", {configurable: true, enumerable:true, get: function() {if(resp)return resp;resp = true;return resp;}})})();\n\n\n\n;(function(){var resp = null;Object.defineProperty(window.navigator, \"doNotTrack\", {configurable: true, enumerable:true, get: function() {if(resp)return resp;resp = null;return resp;}})})();\n\n\n\n;(function(){var resp = null;Object.defineProperty(window.navigator, \"mediaCapabilities\", {configurable: true, enumerable:true, get: function() {if(resp)return resp;resp = (function(){var res = {};var prot = {};if(res)Object.defineProperty(res,'toString', {configurable: true,enumerable: false, get: function() { return function(){return \"[object MediaCapabilities]\"}}});if(res)Object.defineProperty(res,'valueOf', {configurable: true,enumerable: false, get: function() { return function(){return \"[object MediaCapabilities]\"}}});prot[\"decodingInfo\"] = (function(){var res = function(){}; res.toString = function(){return \"function decodingInfo() { [native code] }\"}; res.valueOf = function(){return \"function decodingInfo() { [native code] }\"}; return res;})();Object.setPrototypeOf(res, prot);return res;})();;return resp;}})})();\n\n\n\n;(function(){var resp = null;Object.defineProperty(window.navigator, \"connection\", {configurable: true, enumerable:true, get: function() {if(resp)return resp;resp = (function(){var res = {};var prot = {};if(res)Object.defineProperty(res,'toString', {configurable: true,enumerable: false, get: function() { return function(){return \"[object NetworkInformation]\"}}});if(res)Object.defineProperty(res,'valueOf', {configurable: true,enumerable: false, get: function() { return function(){return \"[object NetworkInformation]\"}}});prot[\"onchange\"] = null;prot[\"effectiveType\"] = \"4g\";prot[\"rtt\"] = 0;prot[\"downlink\"] = 9.7;prot[\"saveData\"] = false;prot[\"downlinkMax\"] = 100;prot[\"type\"] = \"cellular\";prot[\"ontypechange\"] = null;prot[\"addEventListener\"] = (function(){var res = function(){}; res.toString = function(){return \"function addEventListener() { [native code] }\"}; res.valueOf = function(){return \"function addEventListener() { [native code] }\"}; return res;})();prot[\"removeEventListener\"] = (function(){var res = function(){}; res.toString = function(){return \"function removeEventListener() { [native code] }\"}; res.valueOf = function(){return \"function removeEventListener() { [native code] }\"}; return res;})();prot[\"dispatchEvent\"] = (function(){var res = function(){}; res.toString = function(){return \"function dispatchEvent() { [native code] }\"}; res.valueOf = function(){return \"function dispatchEvent() { [native code] }\"}; return res;})();Object.setPrototypeOf(res, prot);return res;})();;return resp;}})})();\n\n\n\n;(function(){var resp = null;Object.defineProperty(window.navigator, \"userActivation\", {configurable: true, enumerable:true, get: function() {if(resp)return resp;resp = (function(){var res = {};var prot = {};if(res)Object.defineProperty(res,'toString', {configurable: true,enumerable: false, get: function() { return function(){return \"[object UserActivation]\"}}});if(res)Object.defineProperty(res,'valueOf', {configurable: true,enumerable: false, get: function() { return function(){return \"[object UserActivation]\"}}});prot[\"hasBeenActive\"] = false;prot[\"isActive\"] = false;Object.setPrototypeOf(res, prot);return res;})();;return resp;}})})();\n\n;(function(){var resp = null;delete window.navigator.plugins;Object.defineProperty(window.navigator, \"plugins\", {configurable: true, enumerable:false, get: function() {if(resp)return resp;resp = (function(){var res = {};var prot = {};if(res)Object.defineProperty(res,'toString', {configurable: true,enumerable: false, get: function() { return function(){return \"[object PluginArray]\"}}});if(res)Object.defineProperty(res,'valueOf', {configurable: true,enumerable: false, get: function() { return function(){return \"[object PluginArray]\"}}});prot[\"length\"] = 0;prot[\"refresh\"] = (function(){var res = function(){}; res.toString = function(){return \"function refresh() {\\n    [native code]\\n}\"}; res.valueOf = function(){return \"function refresh() {\\n    [native code]\\n}\"}; return res;})();prot[\"namedItem\"] = (function(){var res = function(item){var length=window.navigator.plugins.length;for(var i=0;i<length;i++){var p = window.navigator.plugins[i];if(p.name == item)return p}}; res.toString = function(){return \"function namedItem() { [native code] }\"}; res.valueOf = function(){return \"function namedItem() { [native code] }\"}; return res;})();prot[\"item\"] = (function(){var res = function(item){return window.navigator.plugins[item]}; res.toString = function(){return \"function item() { [native code] }\"}; res.valueOf = function(){return \"function item() { [native code] }\"}; return res;})();Object.setPrototypeOf(res, prot);return res;})();;return resp;}})})();;(function(){var resp = null;delete window.navigator.mimeTypes;Object.defineProperty(window.navigator, \"mimeTypes\", {configurable: true, enumerable:false, get: function() {if(resp)return resp;resp = (function(){var res = {};var prot = {};if(res)Object.defineProperty(res,'toString', {configurable: true,enumerable: false, get: function() { return function(){return \"[object MimeTypeArray]\"}}});if(res)Object.defineProperty(res,'valueOf', {configurable: true,enumerable: false, get: function() { return function(){return \"[object MimeTypeArray]\"}}});prot[\"length\"] = 0;prot[\"item\"] = (function(){var res = function(item){return window.navigator.mimeTypes[item]}; res.toString = function(){return \"function item() { [native code] }\"}; res.valueOf = function(){return \"function item() { [native code] }\"}; return res;})();prot[\"namedItem\"] = (function(){var res = function(item){var length=window.navigator.mimeTypes.length;for(var i=0;i<length;i++){var p = window.navigator.mimeTypes[i];if(p.type == item)return p}}; res.toString = function(){return \"function namedItem() { [native code] }\"}; res.valueOf = function(){return \"function namedItem() { [native code] }\"}; return res;})();Object.setPrototypeOf(res, prot);return res;})();;return resp;}})})();;(function(){var resp = null;delete window.navigator.hardwareConcurrency;Object.defineProperty(window.navigator, \"hardwareConcurrency\", {configurable: true, enumerable:false, get: function() {if(resp)return resp;resp = 4;return resp;}})})();})();delete window.openDatabase;","ua":"Mozilla/5.0 (Linux; Android 7.1.1; SM-J510FN Build/NMF26X; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/59.0.3071.125 Mobile Safari/537.36 YandexSearch/8.00 YandexSearchBrowser/8.00","dnt":false,"width":980,"height":1524,"canvas":"66de69d9c7bed332cb9e81749ced618dcd5f1835f0b1f43bb2677ae5ad35cf005ade26a9ec9b4ccebff3b6a71cd62c6239c58ee802fd102474f6cb4666262f09807f8083807d817d7b7e7f838081837b7b7e807d7f7f7e7f7d7b837c7f81827e827e817d837c7c807f7d7f7d7d828280827e7c","webgl":"63703f6976ebf9e4f734cffd02d768876c4d610a86f14ec46bb0941bdc9b24674f2bf043866843a399a7897833337e31410f65c76312e06360c7c2077d16f304807f8083807d817d7b7e7f838081837b7b7e807d7f7f7e7f7d7b837c7f81827e827e817d837c7c807f7d7f7d7d828280827e7c","rectangles":"cb18f6abf1441370163734102c053f173ca5c0992f8d7afe5df39f94dba94e16e6fe56414afbab419eb4192f569195a6bb056a151e41b0294a525ac74b743508154b0000089ffeff45320600fc2d04009e6e0500e6910200d9e70200a2cdfdffef8dffff89650000d651020010570500cd140700517efdff70f7fdff6edffbff4034faff6559fdffc4f40000744b03007911f9ffd426fffff5d8ffff0c3b020008c00300b35afbffdba00000dd33fdffecfd0100b31d0300ed23f9ff387703003e20faff15f0fcff79260300b87efeffb54205002da90400ee0e00002561f8ff5c6b01003301faff028406008ab705006346ffffa240fcff0176050063220200c5d90600c94d060083d30300b7e8fbfff890faff2c96feff18bd04004586fcffe1d2fcfffac10600fd12f9ffc43dfeffcf5f04006432030011e50000a77affff","audio":"ac4bb626a4f186cd2cdc908a8539b4f17b301c41664b6bbeefe95537137a3289494ace64a5ce82fafe25d9c1c8c5312fcf068a06bb1c0b59b532b790cab2220f8c7c6f7e828f938691897d7974907e7c93706d87926b837283727d78708b6f907c828e9282747479887a8f79898f7c8f8a7e8f917970907f908b818c8473828e8a868c8f77836d88706c828174717e8672798f6b7484747a73778086898d6f7a81908779","battery":"196382780a125fbd9691021eb5cd7f8eb5ee85bd04005d65fcb16a66676a50ce3623690f7e5e4cc6ea825c6d277343b15c3cba339f520120db70ce7b1bccf40f0d26465c290d51","has_battery_api":true,"has_battery_device":true,"webgl_properties":{"unmaskedVendor":"Qualcomm","unmaskedRenderer":"Adreno (TM) 306","vendor":"WebKit","renderer":"WebKit WebGL","alphaBits":"8","blueBits":"8","depthBits":"24","greenBits":"8","maxCombinedTextureImageUnits":"32","maxCubeMapTextureSize":"4096","maxFragmentUniformVectors":"224","maxRenderBufferSize":"4096","maxTextureImageUnits":"16","maxTextureSize":"4096","maxVaryingVectors":"16","maxVertexAttribs":"16","maxVertexTextureImageUnits":"16","maxVertexUniformVectors":"256","redBits":"8","stencilBits":"0","extensions":"ANGLE_instanced_arrays,EXT_blend_minmax,EXT_color_buffer_half_float,EXT_texture_filter_anisotropic,WEBKIT_EXT_texture_filter_anisotropic,EXT_sRGB,OES_element_index_uint,OES_standard_derivatives,OES_texture_float,OES_texture_half_float,OES_texture_half_float_linear,OES_vertex_array_object,WEBGL_color_buffer_float,WEBGL_compressed_texture_etc1,WEBGL_debug_renderer_info,WEBGL_debug_shaders,WEBGL_lose_context,WEBKIT_WEBGL_lose_context","shadingLanguage":"WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)","version":"WebGL 1.0 (OpenGL ES 2.0 Chromium)","maxAnisotropy":"16"},"audio_properties":{"BaseAudioContextSampleRate":48000,"AudioContextBaseLatency":0.08016666666666666,"AudioDestinationNodeMaxChannelCount":2},"fonts":["Arial","Courier","Courier New","Georgia","Helvetica","Monaco","Palatino","Tahoma","Times","Times New Roman","Verdana","Baskerville"],"headers":["Host","X-Real-Ip","X-Forwarded-For","Connection","Content-Length","Cache-Control","Accept-Datetime","Origin","X-Csrf-Token","If-Unmodified-Since","Authorization","X-Requested-With","If-Modified-Since","If-Range","X-Http-Method-Override","X-Request-Id","Pragma","Upgrade-Insecure-Requests","User-Agent","Content-Type","Max-Forwards","If-None-Match","If-Match","Range","Accept","Referer","Accept-Encoding","Accept-Language"],"lang":"ru-RU,ru-UA;q=0.9,ru;q=0.8,en-AS;q=0.7,en-US;q=0.6,en;q=0.5","native_code":"function Object() { [native code] }","attr":{"navigator.vendorSub":"","navigator.productSub":"20030107","navigator.vendor":"Google Inc.","navigator.appCodeName":"Mozilla","navigator.appName":"Netscape","navigator.appVersion":"5.0 (Linux; Android 7.1.1; SM-J510FN Build/NMF26X; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/59.0.3071.125 Mobile Safari/537.36 YandexSearch/8.00 YandexSearchBrowser/8.00","navigator.platform":"Linux armv7l","navigator.product":"Gecko","navigator.userAgent":"Mozilla/5.0 (Linux; Android 7.1.1; SM-J510FN Build/NMF26X; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/59.0.3071.125 Mobile Safari/537.36 YandexSearch/8.00 YandexSearchBrowser/8.00","screen.availHeight":640,"screen.availWidth":360,"screen.width":360,"screen.height":640,"screen.colorDepth":24,"screen.pixelDepth":24,"screen.availLeft":0,"screen.availTop":0,"outerHeight":640,"outerWidth":360}}
    

    Забрать юзер агента "Mozilla/5.0 (Linux; Android 7.1.1; SM-J510FN Build/NMF26X; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/59.0.3071.125 Mobile Safari/537.36 YandexSearch/8.00 YandexSearchBrowser/8.00"


Log in to reply