curl sed实例

curl用了请求json数据,jq(apt-get install jq)用来格式化json,sed用来过滤和替换json数据

curl "https://sso.ifanr.com/api/v5/wp/buzz/?limit=100&offset=0" | jq . | sed -e '2,8d' -e '/comment_count/d;/created_at/d;/"id"/d;/like_count/d;/"post_id"/d' -e 's/buzz_original_url/url/g;s/post_content/excerpt/g;s/post_title/title/g'

你可能感兴趣的:(curl sed实例)