Compare commits
2 Commits
a832635a21
...
c30deeed49
Author | SHA1 | Date | |
---|---|---|---|
c30deeed49 | |||
2b0586b0ac |
@ -15,7 +15,10 @@ public class ChatMessage : Phase2Task
|
|||||||
public override async Task<Tuple<TaskStatus, WorkOrder>> ActOn(WorkOrder workOrder)
|
public override async Task<Tuple<TaskStatus, WorkOrder>> ActOn(WorkOrder workOrder)
|
||||||
{
|
{
|
||||||
await Process.Start(ChatScript,
|
await Process.Start(ChatScript,
|
||||||
workOrder.data["chatmessage"] + (await TtrssClient.GetArticles(workOrder.articleId)).First().feed_title
|
workOrder.data["chatmessage"] +
|
||||||
|
(await TtrssClient.GetArticles(workOrder.articleId)).First().feed_title +
|
||||||
|
"; " +
|
||||||
|
(await TtrssClient.GetArticles(workOrder.articleId)).First().title
|
||||||
).WaitForExitAsync();
|
).WaitForExitAsync();
|
||||||
return new Tuple<TaskStatus, WorkOrder>(TaskStatus.Done, workOrder);
|
return new Tuple<TaskStatus, WorkOrder>(TaskStatus.Done, workOrder);
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ namespace ttrss_co_client.tasks
|
|||||||
var extensionUpstream = attachmentLink.Substring(attachmentLink.LastIndexOf('.'));
|
var extensionUpstream = attachmentLink.Substring(attachmentLink.LastIndexOf('.'));
|
||||||
var downloadPath = Path.Combine(workingFolder, headline.title) + extensionUpstream;
|
var downloadPath = Path.Combine(workingFolder, headline.title) + extensionUpstream;
|
||||||
var downloader = new HttpClient();
|
var downloader = new HttpClient();
|
||||||
|
downloader.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (compatible; AcmeInc/1.0)");
|
||||||
sw.Start();
|
sw.Start();
|
||||||
var dlResult = (await downloader.GetAsync(attachmentLink));
|
var dlResult = (await downloader.GetAsync(attachmentLink));
|
||||||
File.WriteAllBytes(downloadPath, await dlResult.Content.ReadAsByteArrayAsync());
|
File.WriteAllBytes(downloadPath, await dlResult.Content.ReadAsByteArrayAsync());
|
||||||
|
Loading…
Reference in New Issue
Block a user