Giter VIP home page Giter VIP logo

vscode-flomo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

edd-gao

vscode-flomo's Issues

上传选中的代码发送到flomo

你好,我觉得代码片段也是可以收集到flomo中的。能不能增加一个功能,选中一段代码,然后右键选择post selected code to flomo。当然,也可用command pallete触发post操作。

如何查看调试信息

你好,偶然发现 vscode 上面发布了这个插件,下来试了一下。
提示“发送失败,请检查 API Key 是否正确”。

我用下面脚本验证了一下 API,是可以用的。想咨询一下什么地方可以看调试信息?谢谢。

#!/bin/env python
# -*- coding: UTF-8 -*-
import os, sys, re
import requests

'''
## 使用方法

0. 安装python,安装requests包 (pip install requests)
1. 系统创建环境变量FLOMOAPI,内容可于https://flomoapp.com/mine?source=incoming_webhook 获取
2. 保存此文件至本地路径,命名为flomo.py
3. 将存放flomo.py的路径添加至系统PATH路径中
4. 执行 flomo.py '文本...'

## 说明

1. 文本中不包含#的,将会增加`#待整理`标签
2. 独立的文本参数分行记录

## 注意

- 命令行输入#,请使用单引号括起来,否则会被当成注释
- 文本中有空格的,请使用单引号括起来,否则会被识别为多行

'''

headers = {'Content-Type': 'application/json;charset=UTF-8'}
flomoapi=os.getenv('FLOMOAPI')

if not flomoapi:
    print("请先创建 FLOMOAPI 环境变量")
    exit()

if len(sys.argv) <= 1:
    print("姿势不对。用法:flomo.py '文本...'")
    exit()

content=''
for argv in sys.argv[1:]:
    content +=  argv + '\n'

if '#' not in content:
    content = '#待整理\n' + content

print(flomoapi)

r = requests.post(flomoapi, headers=headers, json={'content':f'{content}'})

print("----------------")
print(content)
print("----------------")
print(r)
print(r.__dict__)
print(r._content)
if r.status_code == 200:
    print ('MEMO 创建成功')
else:
    print ('MEMO 创建失败。内容宝贵,请注意保存!')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.