Author Topic: Json parser внутри кликера  (Read 2043 times)

0 Members and 1 Guest are viewing this topic.

Луций

  • Активный участник
  • ***
  • Posts: 248
  • чат в телеге: https://t.me/klickermannchat
    • View Profile
    • Пишу скрипты на заказ:
Json parser внутри кликера
« on: April 16, 2021, 01:03:47 PM »
Привет, хочу парсить jsonЫ средствами кликера (разбивать строку на подстроки) пример строки:

{"verbose":true,"summary":{"durationMs":10001,"candidateIps":[{"local":"","remote":""},{"local":"47.63.110.109","remote":"46.101.134.231"}],"localStreamReady":true,"remoteStreamReady":true,"publishedSuccessfully":true,"slowLinkCount":{"publisher":{"toServer":{"count":0,"lostSum":0}},"subscriber":{"fromServer":{"count":0,"lostSum":0}}},"videoBlurDuration":0,"videoDisabled":false,"webrtcDown":{},"videoNotAllowedError":false,"iceDisconnectedCount":0,"incidentCount":{"video bitrate is < 25000_sender":1,"audio bitrate is < 2000_sender":1,"qp is > 200_sender":1,"audio bitrate is < 2000_receiver":1,"connection is inactive_connection":1},"consentDialogsInterval":454,"parallelJanusClientInits":0,"webrtcSupport":true,"userAgent":"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.72 Safari/537.36","lastWebrtcReport":{"sender":{"connectionStatus":"active","sender":{"active":true,"timestamp":1618560037006,"stats":{"active":true,"networkType":"wifi","candidateTypes":{"local":"prflx","remote":"host"},"candidateIps":{"local":"47.63.110.109","remote":"46.101.134.231"},"bytesSent":236508,"availableOutgoingBitrate":262000,"currentRoundTripTime":0.041,"video":{"bytesSent":192859,"framesEncoded":162,"framesSent":162,"nackCount":0,"firCount":1,"pliCount":11,"codec":"VP9","hugeFramesSent":0,"qpSum":29531,"qualityLimitationReason":"none","qualityLimitationResolutionChanges":0,"screen":{"width":640,"height":480},"timestamp":1618560037006},"audio":{"bytesSent":21004,"codec":"opus","timestamp":1618560037006},"timestamp":1618560037006},"qp":207.46153846153845,"fps":{"encoded":13,"sent":13},"bitrate":{"total":34259,"audio":3408,"video":27957}},"receiver":{"active":false}},"receiver":{"connectionStatus":"active","sender":{"active":false},"receiver":{"active":true,"timestamp":1618560035621,"stats":{"active":true,"networkType":"wifi","candidateTypes":{"local":"srflx","remote":"host"},"candidateIps":{"local":"47.63.110.109","remote":"46.101.134.231"},"bytesReceived":17674,"currentRoundTripTime":0.047,"video":{},"audio":{"bytesReceived":9741,"jitter":0.006,"packetsLost":0,"packetsReceived":174,"codec":"opus","timestamp":1618560035621},"timestamp":1618560035621},"fps":{},"bitrate":{"total":2035,"audio":1161},"packetLoss":{"audio":0}}}},"mediaPermissionPopupShown":false,"badNetworkTooltip":{"tooltipShownCount":0,"isUserMuteCameraAfterTooltipWasShown":false},"video":{"muteCount":0,"unmuteCount":0,"qualityLimitationResolutionChanges":0,"sender":{"bitrate":{"max":37502,"min":20500,"percentile5":0,"percentile95":29687}},"receiver":{"bitrate":{"max":0,"min":0,"percentile5":0,"percentile95":0}}},"screenShare":{"count":0,"duration":0},"durationM":0.16668333333333332,"incidentDuration":{"video bitrate is < 25000_sender":1001,"audio bitrate is < 2000_sender":1001,"qp is > 200_sender":3186,"audio bitrate is < 2000_receiver":1573,"connection is inactive_connection":392},"mediaStates":{"audio":{"down":{"count":0,"duration":0},"up":{"count":1,"duration":7133}},"video":{"down":{"count":0,"duration":0},"up":{"count":1,"duration":6856}}},"availableOutgoingBitrate":{"max":262000,"min":262000,"percentile5":0,"percentile95":262000},"availableIncomingBitrate":{"max":0,"min":0,"percentile5":0,"percentile95":0},"audio":{"sender":{"bitrate":{"max":3831,"min":1708,"percentile5":0,"percentile95":3432}},"receiver":{"bitrate":{"max":2824,"min":1161,"percentile5":0,"percentile95":2773}}},"trigger":"timer"}}

в данный момент я заставляю кликерман идти на http://json.parser.online.fr/ вставлять там строку, запускать и копировать результат, и понимаю что в принципе можно эту строку разбивать средствами кликера, например на строки, разделенные запятой и выводить в текстовый файл, возможно кто то делал такое или подскажет как написать?
« Last Edit: April 16, 2021, 03:51:29 PM by Луций »

Космич

  • Активный участник
  • ***
  • Posts: 265
    • View Profile
Re: Json parser внутри кликера
« Reply #1 on: April 16, 2021, 09:41:16 PM »
ты хочешь получить на кликере такой же результат как на сайте?
«Иногда ты ваяешь до тех пор, пока до тебя не дойдёт, что именно ты делаешь.»

Луций

  • Активный участник
  • ***
  • Posts: 248
  • чат в телеге: https://t.me/klickermannchat
    • View Profile
    • Пишу скрипты на заказ:
Re: Json parser внутри кликера
« Reply #2 on: April 24, 2021, 11:14:39 AM »
примерно, мне нужно из длинной горизонтальной строки сделать столбец, так что бы каждый оператор строки (который выделен запятыми) можно было обращаться как к номеру строки в тхт документе

Vint

  • Супермодератор
  • Герой форума
  • *
  • Posts: 3935
  • Лечу куда хочу. cman 4.13.014x32, 4.14.003 W10
    • View Profile
Re: Json parser внутри кликера
« Reply #3 on: April 24, 2021, 05:51:59 PM »
Так там же дерево. Вложенность. Как потом будешь искать нужный.


Космич

  • Активный участник
  • ***
  • Posts: 265
    • View Profile
Re: Json parser внутри кликера
« Reply #4 on: April 24, 2021, 06:41:14 PM »
Ну так скинь пример необработанной и обработанной строки, чтобы было предельно ясно, что требуется получить на выходе.
Например, если тебе нужно разбить строку на подстроки по запятым, тогда в каком виде записывать объекты, массивы? Или это вообще не важно?
«Иногда ты ваяешь до тех пор, пока до тебя не дойдёт, что именно ты делаешь.»