豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit de20bf7

Browse files
committed
def main():
parser = argparse.ArgumentParser(description="Download from Pexels and post to Pinterest") parser.add_argument("--query", required=True, help="Search query for Pexels") parser.add_argument("--count", type=int, default=1, help="Number of items to fetch") parser.add_argument("--use-hosting", action="store_true") parser.add_argument("--include-attribution", action="store_true") args = parser.parse_args() photos = search_pexels(args.query, args.count) if not photos: print("No photos found.") sys.exit(1) for photo in photos: image_url = photo["src"]["original"] photographer = photo.get("photographer", "Unknown") pexels_link = photo.get("url", "") final_image_url = image_url if args.use_hosting: filename = f"temp_{int(time.time())}.jpg" download_file(image_url, filename) final_image_url = upload_to_imgur(filename) os.remove(filename) description = f"Photo about {args.query}" if args.include_attribution: description += f"\n📸 {photographer} via Pexels\n{pexels_link}" response = create_pin( image_url=final_image_url, title=f"{args.query.title()} Inspiration", description=description, alt_text=f"{args.query} image" ) print("✅ Pin created:", response.get("id")) time.sleep(2)
1 parent a12fd56 commit de20bf7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
scriptencoding utf-8
2+
3+
if exists("b:current_syntax")
4+
finish
5+
endif
6+
7+
let s:subtype = matchstr(&l:filetype, '\<copilotpanel\.\zs[[:alnum:]_-]\+')
8+
if !empty(s:subtype) && s:subtype !~# 'copilot'
9+
silent! exe 'syn include @copilotpanelLanguageTop syntax/' . s:subtype . '.vim'
10+
unlet! b:current_syntax
11+
endif
12+
13+
syn region copilotpanelHeader start="\%^" end="^─\@="
14+
syn region copilotpanelItem matchgroup=copilotpanelSeparator start="^─\{9,}$" end="\%(^─\{9,\}$\)\@=\|\%$" keepend contains=@copilotpanelLanguageTop
15+
16+
hi def link copilotpanelHeader PreProc
17+
hi def link copilotpanelSeparator Comment
18+
19+
let b:current_syntax = "copilotpanel"

0 commit comments

Comments
 (0)