• This repository has been archived on 04/Jul/2022
  • Stars
    star
    121
  • Rank 292,219 (Top 6 %)
  • Language
    CSS
  • License
    Other
  • Created over 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

用卡片在个人网站上展示知乎账户

2022.4.24 更新: 由于知乎改了 OAuth 接口,且依赖库 zhihu-oauth 也不再更新,本项目已无法正常工作。感谢用户们这五年的信赖与支持。

用卡片展示你的知乎账户(Try it!)

(Eng ver.)

## 使用

使用个人网址的最后一部分作为 data-userhash 的值,如下:

<div class="zhihu-card" data-userhash="cheng-hao-81"></div>
<script src="https://laike9m.github.io/zhihu-card/dist/widget.js"></script>

注意 widget.js 一定要放在 <div> 的后面。

其它可用的 data-xx 参数包括:

  • theme: 卡片外观主题,包括 zhihu(default), zhihu_newgithub

  • width: 卡片宽度,默认值是 400

  • height: 卡片高度

  • button: 是否显示“关注”按钮,取值为 yes(default)、no

  • description: 在 github 主题中是否显示用户个人简介,取值为 yes(default)、no

  • suffix: 显示在用户名之后的字符串,默认为空

  • key1, key2, key3: 卡片的三栏中显示数值的类型,取值和含义如下:

    取值 含义
    ask 提问数量
    answer 回答数量
    post 文章数量
    agree 赞同数量
    thanks 感谢数量
    follower 关注者数量

默认值 key1=answer, key2=agree, key3=follower

例子

<div class="zhihu-card" data-userhash="cheng-hao-81"
    data-width="400" data-height="300" data-key1="answer" data-key2="agree" data-key3="post" data-theme="github" data-suffix="@知乎"></div>
<script src="https://laike9m.github.io/zhihu-card/dist/widget.js"></script>

English Version

Card to show your profile on zhihu.com.

Usage

Use the last part of your homepage url as data-userhash's value, like this:

<div class="zhihu-card" data-userhash="cheng-hao-81"></div>
<script src="https://laike9m.github.io/zhihu-card/dist/widget.js"></script>

Make sure to place widget.js behind/under <div>.

Available data parameters are:

  • theme: card appearance theme, options: zhihu(default), zhihu_new and github

  • width: card width, default is 400

  • height: card height

  • button: whether to show "follow" button,options: yes(default), no

  • description: when using github theme, whether to show user description, options: yes(default), no

  • suffix: string shown after user name, default is empty

  • key1, key2, key3: control values displayed in three columns, available values and their meaning are shown below:

    value meaning
    ask number of questions
    answer number of answers
    post number of posts
    agree number of agree
    thanks number of thanks
    follower number of followers

default: key1=answer, key2=agree, key3=follower

Example

<div class="zhihu-card" data-userhash="cheng-hao-81"
    data-width="400" data-height="300" data-key1="answer" data-key2="agree" data-key3="post" data-theme="github" data-suffix="@zhihu"></div>
<script src="https://laike9m.github.io/zhihu-card/dist/widget.js"></script>

致谢

特别感谢 @lepture 和他的 github-cards 库。zhihu-card 的前端部分完全是照着 github-cards 写的。

More Repositories

1

Cyberbrain

Python debugging, redefined.
Python
2,507
star
2

pdir2

Pretty dir() printing with joy🍺
Python
1,325
star
3

Python-Type-Challenges

Master Python typing (type hints) with interactive online exercises!
Python
435
star
4

PyPunchP2P

Python实现NAT穿透+STUN+TURN+P2P聊天 | Python P2P chat
Python
428
star
5

My_Blog

My Django Blog
HTML
209
star
6

Cyberbrain-Deprecated

[Deprecation] This project has been deprecated. Development moved to github.com/laike9m/Cyberbrain
Python
166
star
7

ezcf

Import configuration file for Pythonista
Python
159
star
8

rsshub-zhihu-helper

如果你希望通过 RSSHub 浏览知乎,那么这个项目或许可以帮到你。
Python
70
star
9

Bad-Apple-Console

ASCII Art: Bad 🍎 in Windows console
C++
41
star
10

logseq-chatgpt

Talk to ChatGPT directly from Logseq
JavaScript
34
star
11

f

Log to a file without modifying code, with just one line 📝
Python
19
star
12

split_p

漫画图片分割 | split images for manga reading
Python
12
star
13

peerjs-with-nodewebkit-tutorial

How to integrate PeerJs into node-webkit/NW.js app
JavaScript
11
star
14

all_in_utf8

Recursively find and convert files to utf8 encoding
Python
5
star
15

VideoChat

elgg video chat plugin / elgg 视频通话插件
PHP
4
star
16

learn_socket

Learn Python socket programming
Python
3
star
17

CU_login

ChinaUnicom 自动登录断线重连
Python
3
star
18

logseq-twitter-sync

JavaScript
2
star
19

MusicService

读取mp3生成markdown格式的音乐列表
Python
2
star
20

Xylect

TypeScript
2
star
21

DataMining

DataMining Project
Python
1
star
22

spk_cmp2methods

compare 2 methods of speaker change detection
Python
1
star
23

h2-playground

Python
1
star
24

mysite1

My Django Project,consisting of my personal blog and the Mike Hilbert's tutorial things
Python
1
star
25

train

Python
1
star
26

Algorithm_homework_code

Python
1
star
27

pipAlwaysLatest

A wrapper around pip, install/generate requirements with the latest version
Python
1
star
28

Slides

HTML
1
star
29

cyberbrain-examples

Python
1
star
30

DumpRenrenPosts2Markdown

人人日志导出工具/Dump Renren Posts to Markdown
Python
1
star