惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Spread Privacy
Spread Privacy
大猫的无限游戏
大猫的无限游戏
F
Fortinet All Blogs
M
MIT News - Artificial intelligence
G
Google Developers Blog
Hacker News: Ask HN
Hacker News: Ask HN
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
H
Help Net Security
V
Visual Studio Blog
WordPress大学
WordPress大学
博客园 - 司徒正美
TaoSecurity Blog
TaoSecurity Blog
Webroot Blog
Webroot Blog
Hugging Face - Blog
Hugging Face - Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
W
WeLiveSecurity
C
CERT Recently Published Vulnerability Notes
Y
Y Combinator Blog
S
Schneier on Security
Recent Announcements
Recent Announcements
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
宝玉的分享
宝玉的分享
T
Troy Hunt's Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 三生石上(FineUI控件)
Microsoft Azure Blog
Microsoft Azure Blog
N
News and Events Feed by Topic
A
About on SuperTechFans
小众软件
小众软件
K
Kaspersky official blog
Help Net Security
Help Net Security
V2EX - 技术
V2EX - 技术
P
Proofpoint News Feed
S
Secure Thoughts
IT之家
IT之家
云风的 BLOG
云风的 BLOG
N
Netflix TechBlog - Medium
The Register - Security
The Register - Security
I
Intezer
NISL@THU
NISL@THU
GbyAI
GbyAI
P
Privacy & Cybersecurity Law Blog
T
Threatpost
C
Check Point Blog
Forbes - Security
Forbes - Security
C
Cisco Blogs
AI
AI
Recorded Future
Recorded Future
F
Full Disclosure

夜行人

回家路上 第一期的直播演示项目 震动检测器 正能量 在线参观CodeLab Neverland 发布 CodeLab Adapter 3.3.1 DynamicTable 之 纸糊方向盘 CodeLab DynamicTable: 一个可实施的技术方案 CodeLab Insight 发布 Alpha 版 情人节 Home Assistant 周报 && IoT 周报 (02) Joplin: 关注隐私的 Evernote 开源替代软件 浏览器的未来与 Web 传感器 Home Assistant 周报 && IoT 周报 (01) 百宝箱(01) 论自由 介绍 WebThings Home Assistant 周报 && iot 周报 (00) 百宝箱(00) 毛姆读书心得 传世之作 周末徒步 CodeLab Adapter ❤️ Jupyter/Python 航班 躲雨 夏令营途中 [译]思想--作为一种技术 The future of coding 美国之行 三门问题的程序模拟 从Python转向Pharo https://blog.just4fun.site/post/iot/iot-open-source-projects/ Python异步编程笔记 https://blog.just4fun.site/post/iot/iot-open-source-hardware-community/ 万物积木化开发者社区 CodeLab ❤️ Blender Scratch3技术分析之云变量 API(第7篇) [译]对管道(Pipes)的偏爱 [译]提出正确的问题比得到正确答案更重要 蓝牙设备与Scratch3.0 创建你的第一个Scratch3.0 Extension Scratch3技术分析之项目内部数据(第6篇) Scratch3技术分析之User API(第4篇) Scratch3技术分析之项目主页API(第3篇) Scratch3技术分析之静态资源API(第2篇) Scratch3.0、micro:bit与Windows7 https://blog.just4fun.site/post/iot/zerynth-vs-micropython/ 核聚变、方所与半宅空间 可视化编程为何是个糟糕的主意 codelab.club周末聚会 关于codelab.club '下一件大事'是一个房间 Hungry Robot - Eat everything 编程作为一种思考方式 今日简史 史蒂夫·乔布斯传 罗素自选文集 https://blog.just4fun.site/post/edx/tianjin-scratch-ai/ https://blog.just4fun.site/post/edx/richie-cms-openedx/ 徒步武功山 WebUSB与micro:bit 积木化编程与3D场景 夜宿武功山顶 scratch3-adapter接入优必选Alpha系列机器人 https://blog.just4fun.site/post/edx/video-migration-note/ scratch3-adapter重构笔记 https://blog.just4fun.site/post/edx/edx-community-members/ 两种硬件编程风格的比较 使用micro:bit自制PPT翻页笔 柏拉图对话集 scratch3.0 + micro:bit 七月电影放映计划 非营利组织的管理 Screenly--用树莓派让任何屏幕变为可编程的数字标牌 以最佳实践开始你的Django项目 micro:bit与事件驱动 为Scratch3.0设计的插件系统(上篇) OCR应用一例 近两年读过的一些好书 blockly开发之使用python驱动浏览器中的turtle(2) 牛顿新传 文学理论入门 逻辑的引擎 人生的意义 blockly开发之生成并运行js代码(1) blockly开发之hello world(0) micro:bit使用笔记 神器之Termux https://blog.just4fun.site/post/iot/micropython-notes/ Cozmo what is this Scratch的前世今生 下段旅程 我行在远方 爆裂 途中杂记 https://blog.just4fun.site/post/edx/open-edx-startup/ cozmo系列之入门 - 有性格且可编程的机器人 PaperWeekly开发笔记 创业二三事 blockly与结对编程
Scratch3技术分析之社区 API(第5篇)
种瓜 · 2019-01-16 · via 夜行人

文章目录

我们主要关心以下页面的API:

  • 社区主页: https://scratch.mit.edu/
  • 发现页: https://scratch.mit.edu/explore/projects/all

我们可以把这些API视为项目查询接口,查询社区用户已创建的项目(Projects), 这些接口的不同只是查询的条件不同。

社区主页

已登陆用户和未登录用户看到的社区主页,略有不同,我们分别分析。

未登录用户

GET https://api.scratch.mit.edu/proxy/featured

已登陆用户

GET https://api.scratch.mit.edu/proxy/featured

返回数据相同。

已登陆用户会请求更多的API:

新闻接口:

GET https://api.scratch.mit.edu/news?limit=3

返回:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
[
  {
    "id": 181868395058,
    "stamp": "2019-01-09T13:53:40.000Z",
    "headline": "Updates and Bug Fixes!",
    "url": "https://scratch.mit.edu/discuss/topic/331439/",
    "image": "https://66.media.tumblr.com/2bbe2bc9317585c1de96c91f56bb061b/tumblr_inline_pad1ik8d2k1tqsk9m_540.png",
    "copy": "We have some updates and bug fixes for you! See here for more information…"
  },
  {
    "id": 181645899223,
    "stamp": "2019-01-02T14:49:48.000Z",
    "headline": "Scratch 3.0 is here!",
    "url": "https://scratch.mit.edu/discuss/topic/326861/",
    "image": "https://66.media.tumblr.com/2bbe2bc9317585c1de96c91f56bb061b/tumblr_inline_pad1ik8d2k1tqsk9m_540.png",
    "copy": "Scratch 3.0 has launched! See here for more information…"
  },
  {
    "id": 181645869948,
    "stamp": "2019-01-02T14:48:22.000Z",
    "headline": "First Scratch Design Studio in 3.0",
    "url": "https://scratch.mit.edu/studios/5801323/",
    "image": "https://66.media.tumblr.com/ee9c9705a8c0334c07c6a32303ec0748/tumblr_inline_p7in9yfrIU1tqsk9m_540.png",
    "copy": "Have you ever wondered what life might be like in the year 3000? Here is your chance to share your dreams and wishes for the future!  "
  }
]
关注者赞过的项目

GET https://api.scratch.mit.edu/users/wwj718/following/users/loves

返回:

关注的工作室的项目

GET https://api.scratch.mit.edu/users/wwj718/following/studios/projects

返回:

发现页

发现页可以用于发现项目工作室。工作室(Studio)目前官方还没有迁移完,我们暂时不关心。(工作室非常接近知乎收藏夹的概念)。

默认请求

GET https://api.scratch.mit.edu/explore/projects?limit=16&offset=0&language=zh-cn&mode=trending&q=*

默认情况下,选择了全部热门的简体中文(页底),从url参数你可以看到这些。

最受欢迎的动画

GET https://api.scratch.mit.edu/explore/projects?limit=16&offset=0&language=zh-cn&mode=popular&q=animations

观察URL参数,我们便搞懂了发现页的API细节了。