*! version 1.4 22july2024
help lianxh 中文版

Title

lianxh -- search blogs of lianxh.cn, and show results in Stata's Results Window in format of Plain text, Markdown or TeX.

Quick examples

. lianxh DID

. lianxh DID 多期 +

. lianxh DID, new(10)

. lianxh DID, hot(10)

. lianxh Bootstrap, md

. lianxh Bootstrap, md0 nocat

. lianxh 张 李, f(author) gsort(-click) hot(20) c d

Description

lianxh makes it easy for users to search blog posts and useful links from within Stata Command Window. It is primarily designed for Chinese users. One can also list common Stata resource links, including Stata official website, Stata
FAQs, Statalist,
Stata Journal,
Stata online tutorial, replication data & programs etc.

If no additional options are specified, lianxh will present the query results in the Stata results window.

By setting options such as md, text, etc., you can display the search results in Markdown or txt format, making it convenient for personal notes or sharing with others via WeChat/email.

When combined with options such as hot(#), new(#), fromto(), you can filter tweets within a specific time range, or present the "most hot" or the "latest" tweets.

Syntax

lianxh
[keywords,
options]

Note 1: keywords represents the keywords to be searched and can include multiple keywords. If keywords is empty, all tweets will be presented.

o 'k1 k2 k3' indicates that the search terms include 'k1', or 'k2', or 'k3';

o 'k1 k2 k3 +' indicates that the search terms simultaneously include 'k1', 'k2', and 'k3'.

Note 2: The fields(varlist) and exfields(varlist) options are used to control the inclusion or exclusion of fields in the search.

o Available fields include: author, title, keyword, catname, representing the author, title, keyword, and category of tweets, respectively.

o If the user enters the lianxh DID RDD command without specifying the fields(varlist) and exfields(varlist) options, lianxh will search for the specified keywords in the
author, title, keyword fields simultaneously.

Options

Option Description

Searching Fields and Time Range

fields(varlist) Searching Fields, including: author, catname, title, keyword
exclude(string) Keywords to be excluded, e.g., ex(Python); ex(py matlab +)
exfields(varlist) Fields where the excluded keywords are located, see fields(varlist)
hot(#) Top # tweets by clicktimes; conflict with new(#)
new(#) Newest # tweets
fromto(string) Time range, e.g., from(2022), from(2021-10 2023-1)
updata Force update local data (takes 2-3 seconds)
automatically takes effect when new(#) is set.

Show click times and date

clicktimes display click times
date display publish date

Style of output

simple Minimalistic style. Displays only tweet titles.
numlist Show tweet numbers. Automatically loads the nocat option when set.
browse Display search results directly in the browser.
gsortby(varlist) Sort search results according to gsort varlist.
varlist can be one or more of: click/view, date, author, catname, title
md Markdown: - Author, Year, [title](URL), jname No.#.
md0 Markdown: - [Author](url), Year, [title](URL), jname No.#.
md1 Markdown: - [title](URL)
md2 Markdown: - Author, Year, [title](URL)
mdc Markdown citation: Author([Year](url_blog))
mdca Markdown citation: [Author](author_link)([Year](url_blog))
latex TeX format: Author, Year, \href, jname No.#.
lac TeX citation format: Author(\href)
weixin WeChat format: Author, Year, title, URL
text Plain text format, same as weixin
view view Markdown / text documents
jname(string) set the name of blog series.

Control and Save

cls clears the Results window first
nocat Do not display classification information for tweets
norange Do not display 'time range' information (Rarely used)
nopreserve When excute lianxh, do not execute preserve and restore
Note: Data in current memory will be cleared (Rarely used)
savetopwd Save [_lianxh_temp_out_.md] at current directory. Default: [../PLUS]
savedta(string) Save the results as Stata's .dta file. (Rarely used)

Examples

o Basic Usage

Search for tweets containing the keyword 'RDD'

. lianxh RDD

Search for tweets containing either 'RDD' or '断点'

. lianxh RDD 断点

Search for tweets containing both 'RDD' and '断点' (the '+' can be placed anywhere in the search query)

. lianxh RDD 断点 +

Display some commonly used resource links, including: paper reproduction websites, online courses, etc.

. lianxh, links

o Set Fields and Time Range

Search for the keyword 'DID' only in the 'Title' field

. lianxh DID, field(title)

Note: By default, searches are conducted in the fields simultaneously.

Search for tweets published by authors with the surname '张'

. lianxh 张, f(a)

Note: f(a) is shorthand for field(author).

Display tweets containing the keyword '面板数据,' excluding those with '动态' and '空间' in the and fields

. lianxh 面板数据, ex(动态 空间) exfield(t k)

Time Range: Since January 1, 2022

. lianxh DID, fromto(2022) d

Time Range: Specify start and end dates

. lianxh 数据, fromto(2023-5-1 2023/10/31)

o Newest, Hottest, Sorting, Click-through Rate, and Publication Time

Display the ten latest tweets

. lianxh, new(10)

Display search results in chronological order

. lianxh DID RDD, new(200)

Display the ten tweets with the highest click-through rate

. lianxh, hot(10)

Display search results sorted by click-through rate, showing click times (clicktimes) and publication date (date)

. lianxh 动态面板, gsort(-click) c d

Sort by year and click-through rate in descending order, others as above

. lianxh DID, gsort(-year -click) c d

o Output in Markdown, Text, and LaTeX Formats

Display search results in Markdown format (click the blue 'View' link in the results window for easier copying)

. lianxh PSM, md

. lianxh PSM, md0

. lianxh PSM, mdc

. lianxh PSM, mdca

Change the series name of tweets

. lianxh PSM, md nocat jname(我最喜欢的推文)

When sharing tweet information via email or WeChat, use the weixin or text options

. lianxh binscatter, w

. lianxh binscatter, t nocat

o Other

Clear the screen and display search results

. lianxh DID, cls

Force update local data

. lianxh DID, updata

Note: By default, lianxh downloads data from https://www.lianxh.cn daily and stores it in the local [../PLUS/l] folder. Subsequent searches use local data, significantly improving search speed. To update to the latest version of local dataset, use the updata option. Hint: It's not 'update,' but 'updata.'

Authors

Yujun, Lian* (连玉君) Lingnan College, Sun Yat-Sen University, China.

E-mail: arlionn@163.com

Blog: lianxh.cn

Junjie, Kang (康峻杰) Shanghai Jiaotong University, China.

E-mail: 642070192@qq.com

Ruihan, Liu (刘芮含) National University of Singapore, Singapore.

E-mail: 2428172451@qq.com

Questions and Suggestions

If you encounter any issues or have suggestions while using the tool, we will address them promptly. Please email us at:
arlionn@163.com.

You can also submit your suggestions by filling out Issues in the project's GitHub repository.

Also see

Online:
songbl (if installed),
cnssc (if installed),
lxhuse (if installed)