├── images ├── action.png ├── settings.png ├── failedrequest1.png └── failedrequest2.png ├── src ├── images │ └── icon.png ├── plugin.json ├── Settings.cs ├── Wox.Plugin.Todoist.csproj ├── TodoistAPI.cs ├── WoxSettingsStorage.cs ├── SettingsControl.xaml ├── SettingsControl.xaml.cs └── TodoistPlugin.cs ├── .github └── workflows │ └── publish.yml ├── Wox.Plugin.Todoist.sln ├── README.md └── .gitignore /images/action.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjw24/Wox.Plugin.Todoist/HEAD/images/action.png -------------------------------------------------------------------------------- /images/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjw24/Wox.Plugin.Todoist/HEAD/images/settings.png -------------------------------------------------------------------------------- /src/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjw24/Wox.Plugin.Todoist/HEAD/src/images/icon.png -------------------------------------------------------------------------------- /images/failedrequest1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjw24/Wox.Plugin.Todoist/HEAD/images/failedrequest1.png -------------------------------------------------------------------------------- /images/failedrequest2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jjw24/Wox.Plugin.Todoist/HEAD/images/failedrequest2.png -------------------------------------------------------------------------------- /src/plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "ID": "F71F6EE367D34BAFB681A9287ACF59EB", 3 | "ActionKeyword": "t", 4 | "Name": "Todoist", 5 | "Description": "A plugin to add tasks to todoist.", 6 | "Author":"DanielBV", 7 | "Version":"3.0.1", 8 | "Language": "csharp", 9 | "Website": "https://github.com/jjw24/Wox.Plugin.Todoist", 10 | "ExecuteFileName": "Wox.Plugin.Todoist.dll", 11 | "IcoPath":"images\\icon.png" 12 | } 13 | -------------------------------------------------------------------------------- /src/Settings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net; 4 | 5 | namespace Wox.Plugin.Todoist 6 | { 7 | public class Settings 8 | { 9 | 10 | public HttpStatusCode LastFailedStatusCode { get; set; } 11 | 12 | public List FailedRequests { get; set; } 13 | 14 | public Settings() 15 | { 16 | api_key = ""; 17 | FailedRequests = new List(); 18 | LastFailedStatusCode = HttpStatusCode.OK; 19 | } 20 | 21 | public string api_key { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish Release 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: [ master ] 7 | paths-ignore: 8 | - .github/workflows/* 9 | 10 | jobs: 11 | publish: 12 | runs-on: windows-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Setup .NET 16 | uses: actions/setup-dotnet@v1 17 | with: 18 | dotnet-version: 6.0.x 19 | - name: get version 20 | id: version 21 | uses: notiz-dev/github-action-json-property@release 22 | with: 23 | path: 'src/plugin.json' 24 | prop_path: 'Version' 25 | - run: echo ${{steps.version.outputs.prop}} 26 | - name: Build 27 | run: | 28 | dotnet publish 'src/Wox.Plugin.Todoist.csproj' --framework net6.0-windows -c Release -o "Todoist" 29 | 7z a -tzip "Wox.Plugin.Todoist.zip" "Todoist/*" 30 | rm -r "Todoist" 31 | - name: Publish 32 | uses: softprops/action-gh-release@v1 33 | with: 34 | files: "Wox.Plugin.Todoist.zip" 35 | tag_name: "v${{steps.version.outputs.prop}}" 36 | env: 37 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 38 | -------------------------------------------------------------------------------- /Wox.Plugin.Todoist.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31019.35 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Wox.Plugin.Todoist", "src\Wox.Plugin.Todoist.csproj", "{529FE658-D2F3-438C-837C-97EFB8AB0790}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {529FE658-D2F3-438C-837C-97EFB8AB0790}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {529FE658-D2F3-438C-837C-97EFB8AB0790}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {529FE658-D2F3-438C-837C-97EFB8AB0790}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {529FE658-D2F3-438C-837C-97EFB8AB0790}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {B51F570D-A6FE-436A-833A-E1070863F151} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /src/Wox.Plugin.Todoist.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0-windows 5 | Library 6 | true 7 | true 8 | true 9 | false 10 | 11 | 12 | 13 | ..\Output\Debug\Wox.Plugin.Todoist 14 | 15 | 16 | 17 | ..\Output\Release\Wox.Plugin.Todoist 18 | 19 | 20 | 21 | 22 | PreserveNewest 23 | 24 | 25 | PreserveNewest 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/TodoistAPI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net; 4 | using System.Net.Http; 5 | using System.Net.Http.Headers; 6 | using System.Threading.Tasks; 7 | 8 | namespace Wox.Plugin.Todoist 9 | { 10 | class TodoistAPI 11 | { 12 | private static readonly HttpClient client = new HttpClient(); 13 | 14 | public TodoistAPI() 15 | { 16 | 17 | } 18 | 19 | public Task CreateQuickTask(string api_key, string task) 20 | { 21 | var values = new Dictionary 22 | { 23 | { "text", task } 24 | }; 25 | var content = new FormUrlEncodedContent(values); 26 | client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", api_key); 27 | var request = client.PostAsync("https://api.todoist.com/sync/v9/quick/add", content); 28 | return request.ContinueWith((taskRequest) => 29 | { 30 | try 31 | { 32 | HttpResponseMessage response = taskRequest.Result; 33 | return response.StatusCode; 34 | } 35 | catch (Exception) 36 | { 37 | return HttpStatusCode.ServiceUnavailable; 38 | } 39 | 40 | }); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is a port of the Wox plugin Wox.Plugin.Todoist created by Daniel Bazaco (@DanielBV). 2 | 3 | This port is intended to be used for [Flow Launcher](https://github.com/Flow-Launcher/Flow.Launcher). It will not work for Wox. 4 | 5 | To download and use this plugin, from [Flow](https://github.com/Flow-Launcher/Flow.Launcher/releases/latest) type `pm install todoist`. 6 | 7 | ------------------- 8 | 9 | # Wox.Plugin.Todoist 10 | 11 | Unofficial Wox plugin to use [Todoist's Quick Add](https://get.todoist.help/hc/en-us/articles/115001745265-Task-Quick-Add). 12 | 13 | # Installation 14 | 15 | ``` 16 | wpm install Todoist 17 | ``` 18 | 19 | # Usage 20 | 21 | 1. Set your API key in the plugin settings 22 | 23 | ![The image doesn't work :(](images/settings.png) 24 | 25 | 2. Add a task using the action keyword 't'. 26 | ![The image doesn't work :(](images/action.png) 27 | 28 | You can use all the features of [Todoist's Quick Add](https://get.todoist.help/hc/en-us/articles/115001745265-Task-Quick-Add) (natural language, labels, priority...) 29 | 30 | ## Failed to create task 31 | If a result like this one appears, it means the plugin failed to create a previous task. 32 | 33 | ![The image doesn't work :(](images/failedrequest1.png) 34 | 35 | You can try again by clicking the result. Due to the way Wox is implemented, the list of results won't update unless you type something in the launcher. If after typing somethign the result remains, you can go to the plugin's settings to see why it's failing. 36 | 37 | ![The image doesn't work :(](images/failedrequest2.png) 38 | -------------------------------------------------------------------------------- /src/WoxSettingsStorage.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Net; 3 | 4 | namespace Wox.Plugin.Todoist 5 | { 6 | public class WoxSettingsStorage 7 | { 8 | 9 | private Settings settings; 10 | 11 | public WoxSettingsStorage(Settings settings) 12 | { 13 | this.settings = settings; 14 | } 15 | 16 | public string Api_key 17 | { 18 | get 19 | { 20 | return settings.api_key; 21 | } 22 | 23 | set 24 | { 25 | settings.api_key = value; 26 | } 27 | } 28 | 29 | public List FailedRequests 30 | { 31 | get 32 | { 33 | return settings.FailedRequests; 34 | } 35 | } 36 | 37 | public void AddFailedRequest(string value) 38 | { 39 | FailedRequests.Add(value); 40 | } 41 | 42 | public void RemoveFailedRequest(string value) 43 | { 44 | FailedRequests.Remove(value); 45 | } 46 | 47 | public void SetLastFailedHttpCode(HttpStatusCode code) 48 | { 49 | settings.LastFailedStatusCode = code; 50 | } 51 | 52 | public void EmptyLastFailedHttpCode() 53 | { 54 | settings.LastFailedStatusCode = HttpStatusCode.OK; 55 | } 56 | 57 | 58 | public HttpStatusCode GetLastFailedHttpCode() 59 | { 60 | return settings.LastFailedStatusCode; 61 | } 62 | 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/SettingsControl.xaml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |