jq

问卷星全自动刷流量

余生长醉 提交于 2020-07-29 07:53:31
之前的代码在其他电脑运行的时候竟然出错,重新修改了下,另外本脚本需要在油猴子脚本上使用,具体使用方法可以参考网上的一些经验,当然我自己也写了一篇文章说下 油猴子的下载和使用 。 说来也是因为懒就想写个代码帮我刷问卷星的浏览量。 本来想着自己写一个脚本来着,无奈太懒,在网上找了一个别人写好的代码,但发现网上的代码无法过安检,总是刷新太快。所以呢灵机一动改了改分享给大家 注:代码一分钟提交一次,不要太快。 // ==UserScript== // @name 问卷星 自动随机填写 // @namespace https://github.com/Ahaochan/Tampermonkey // @version 0.0.4 // @description 问卷星 自动随机填写, 目前支持单选题, 多选题, 比重题, 有需要自动填写的题型, 请在反馈或issue提出并附带问卷地址。github:https://github.com/Ahaochan/Tampermonkey,欢迎star和fork。 // @author Ahaochan // @include https://www\.wjx\.cn/[(jq)|(m)|(hj)]/\d+\.aspx // @match https://www.wjx.cn/* // @grant GM.setValue // @grant GM

前端学不动了怎么办?3年,5年,10年,都需要规划!

心已入冬 提交于 2020-07-28 19:02:43
前端学不动的根本原因是目标感不强或者根本就没有目标。在学习前端之前,我们需要先思考我们要成为一个什么样前端工程师。接下来我们以时间线的方式,来告诉我们什么时间该做什么事儿。本文以普通人为例,也是想给普通人一些思路,结合自己的情况走出自己的路,超人请自行退出。 一、 1-3年(p5-p6) 这个时候大多数是应届生学习知识的积累期,对于前端三剑客:HTML/Javascript/CSS基础的夯实阶段。必看的书有《Javascript权威指南》/《Head First HTML and CSS, XHTML》/HTML方面多看看官方文档或者w3c的标准就成。另外这时候一般的前端工程师,会掌握一门应用级别框架(比如:React/Vue/Angular等等)。虽然使用传统三剑客我们也可以把任务完成,但是使用应用级别的框架还是会提高我们的效率,而且公司在人才招聘的时候应用级别的框架是必问的。不做赘述这个阶段感觉推不动的前端朋友建议推出,做自己更喜欢的事儿去吧。 本阶段关键词:(前端基础、原始积累、HTML/CSS/Javascript、Vue/React/Angular) 二、3-6年(p6-p7) 熬过艰难的初期阶段,接下来2-3年是一个差异化的体验期,在这个时间段通常情况下,前端工程师已经能够胜任所有的业务需求。可能大项目的拆解能力有所欠缺,但是这种能力会通过经验的积累不断积累有所上升

jQuery--高级

▼魔方 西西 提交于 2020-07-27 12:54:56
jQuery--高级 博客说明 文章所涉及的资料来自互联网整理和个人总结,意在于个人学习和经验汇总,如有什么地方侵权,请联系本人删除,谢谢! 动画 三种方式显示和隐藏元素 默认显示和隐藏方式 show([speed,[easing],[fn]]),参数: speed:动画的速度。三个预定义的值("slow","normal", "fast")或表示动画时长的毫秒数值(如:1000) easing:用来指定切换效果,默认是"swing",可用参数"linear" swing:动画执行时效果是 先慢,中间快,最后又慢 linear:动画执行时速度是匀速的 fn:在动画完成时执行的函数,每个元素执行一次。 hide([speed,[easing],[fn]]) toggle([speed],[easing],[fn]) 滑动显示和隐藏方式 slideDown([speed],[easing],[fn]) slideUp([speed,[easing],[fn]]) slideToggle([speed],[easing],[fn]) 淡入淡出显示和隐藏方式 fadeIn([speed],[easing],[fn]) fadeOut([speed],[easing],[fn]) fadeToggle([speed,[easing],[fn]]) 遍历 js的遍历方式 for(初始化值

Improving performance when using jq to process large files

守給你的承諾、 提交于 2020-07-21 03:14:07
问题 Use Case I need to split large files ( ~5G ) of JSON data into smaller files with newline-delimited JSON in a memory efficient way (i.e., without having to read the entire JSON blob into memory). The JSON data in each source file is an array of objects. Unfortunately, the source data is not newline-delimited JSON and in some cases there are no newlines in the files at all. This means I can't simply use the split command to split the large file into smaller chunks by newline. Here are examples

Convert all json keys to lowercase using jq

为君一笑 提交于 2020-07-06 10:55:01
问题 I'm looking to ingest a JSON file with arrays into my database. The json file with array items is as below:- { "campaignId": "11067182", "campaignName": "11067182", "channelId": "%pxbid_universal_site_id=!;", "channelName": "%pxbid_universal_site_id=!;", "placementId": "%epid!", "placementName": "%epid!", "publisherId": "%esid!", "publisherName": "%esid!", "hitDate": "2017-03-23", "lowRiskImpressions": "61485", "lowRiskPct": "64.5295", "moderateRiskImpressions": "1887", "moderateRiskPct": "1

Convert all json keys to lowercase using jq

≡放荡痞女 提交于 2020-07-06 10:54:31
问题 I'm looking to ingest a JSON file with arrays into my database. The json file with array items is as below:- { "campaignId": "11067182", "campaignName": "11067182", "channelId": "%pxbid_universal_site_id=!;", "channelName": "%pxbid_universal_site_id=!;", "placementId": "%epid!", "placementName": "%epid!", "publisherId": "%esid!", "publisherName": "%esid!", "hitDate": "2017-03-23", "lowRiskImpressions": "61485", "lowRiskPct": "64.5295", "moderateRiskImpressions": "1887", "moderateRiskPct": "1

JQ - How to define filter to remove brackets, quotes and commas from output array

╄→尐↘猪︶ㄣ 提交于 2020-06-27 18:41:31
问题 I need to convert an output array to lines without brackets, quotes and commas, so that it can be used to create git clones. This is my original query curl -s http://bitbucketlocalserver:7990/rest/api/1.0/projects/PROJECT_NAME/repos?per_page=20 ^ -u user:pass | H:\Downloads\Win64\jq-win64.exe -r "[.values[] | ((.links.clone[] | select(.name==\"http\") | .href) + \" \" + .name)]" which returns an output of the format [ "http://bitbucketlocalserver:7990/scm/PROJECT_NAME/gitrepo1.git

jq streaming - filter nested list and retain global structure

非 Y 不嫁゛ 提交于 2020-06-25 21:14:38
问题 In a large json file, I want to remove some elements from a nested list, but keep the overall structure of the document. My example input it this (but the real one is large enough to demand streaming). { "keep_untouched": { "keep_this": [ "this", "list" ] }, "filter_this": [ {"keep" : "true"}, { "keep": "true", "extra": "keeper" } , { "keep": "false", "extra": "non-keeper" } ] } The required output just has one element of the 'filter_this' block removed: { "keep_untouched": { "keep_this": [

Delete objects and arrays with jq which match a key

前提是你 提交于 2020-06-25 09:06:06
问题 I have a JSON with the following content: { "data": [ { "name": "Test", "program": { "publicAccess": "--------", "externalAccess": false, "userGroupAccesses": [ { "access": "r-------" }, { "access": "rw------" } ], "id": "MmBqeMLIC2r" }, "publicAccess": "rw------" } ] } And I want to delete all keys (recursively) which match publicAccess or userGroupAccesses , so that my JSON looks like this: { "data": [ { "name": "Test", "program": { "externalAccess": false, "id": "MmBqeMLIC2r" } } ] } I've

Check if string is a valid JSON with jq

十年热恋 提交于 2020-06-24 07:07:19
问题 I need to catch an error when lifting a service. The response can be null , a string error message like error services-migration/foobar: Not found: services-migration/foobar or a valid JSON when everything is fine. I was wondering if there is a way with jq to simply check if the provided string is a valid JSON. I could ofc check the string for some keywords like error f.e., but I'm looking for a more robust option, where eg. I get a true/false or 1/0 from jq. I was looking through the docs of