// See https://aka.ms/new-console-template for more information
var cookie = "";
var sleepInterval = 1000;
Console.WriteLine("Hello, World!");
while (true)
{
var newPosts = CheckNewPost();
foreach (var post in newPosts)
{
var result = CreatePost(post);
}
Thread.Sleep(sleepInterval);
}
void Login(string username, string password)
{
cookie = "someval";
return;
}
PostResult CreatePost(string postUrl)
{
var result = Process(postUrl);
return new PostResult();
}
string Process(string postUrl)
{
return "";
}
IEnumerable<string> CheckNewPost()
{
var list = new List<string>();
list.Add("http://test.com/post123.html");
list.Add("http://test.com/post124.html");
list.Add("http://test.com/post125.html");
return list;
}
public class PostResult
{
}
function fallbackCopyTextToClipboard (text) {
var textArea = document.createElement('textarea')
textArea.value = text
// Avoid scrolling to bottom
textArea.style.top = '0'
textArea.style.left = '0'
textArea.style.position = 'fixed'
document.body.appendChild(textArea)
textArea.focus()
textArea.select()
try {
var successful = document.execCommand('copy')
var msg = successful ? 'successful' : 'unsuccessful'
console.log('Fallback: Copying text command was ' + msg)
} catch (err) {
console.error('Fallback: Oops, unable to copy', err)
}
document.body.removeChild(textArea)
}
function copyTextToClipboard (text) {
if (!navigator.clipboard) {
fallbackCopyTextToClipboard(text)
return
}
navigator.clipboard.writeText(text).then(function () {
// console.log('Async: Copying to clipboard was successful!')
}, function (err) {
console.error('Async: Could not copy text: ', err)
})
}
copyTextToClipboard(val)
"country":{"en":"Russia","ru":"Россия","iso_code":"RU"}