using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using sharpknife.Controls;
using sharpknife.Data;
using sharpknife.Utils;
#if WIN32
using MSHTML;
using System.Globalization;
using sharpknife.Commands;
using sharpknife.Engines;
#else
using mshtml;
#endif
namespace sharpknife.Strategies
{
public class ProBuxStrategy : Strategy
{
public override bool CheckLogin(WebBrowserControl browser, PTCSource source)
{
return (browser.Search("Login") && !browser.Search(source.Username));
}
public override void Login(WebBrowserControl browser, PTCSource source)
{
//
//
//
IHTMLInputElement username = (IHTMLInputElement)HtmlUtils.GetElement(browser.Document, "username");
IHTMLInputElement password = (IHTMLInputElement)HtmlUtils.GetElement(browser.Document, "password");
username.value = source.Username;
password.value = source.Password;
password.form.submit();
}
public override decimal GetBalance(WebBrowserControl browser, PTCSource source)
{
//
Main balance:
$0.0600
string html = browser.Html;
string value = StringUtils.GetTokens(html, "{}Main balance:{}${}{}")[2];
return decimal.Parse(value, CultureInfo.InvariantCulture.NumberFormat);
}
public override bool SolveCaptcha(WebBrowserControl browser, PTCSource source)
{
throw new NotImplementedException();
}
public override Ad ParseMail(Mail mail)
{
throw new NotImplementedException();
}
public override bool ParseAds(WebBrowserControl browser, PTCSource source)
{
//
//
//
//
//
//
IntLinx
//
//
//
//
//
The power of simplicity
//
5 Sec· $0.001
//
//
//
//
//
IHTMLElementCollection elements = HtmlUtils.GetElementCollection(browser.Document, "div");
foreach (IHTMLElement element in elements)
{
string html = element.outerHTML;
//
::::Best PTC Paying Sites:::::
if (element.className == "anc-style" && !StringUtils.Contains(html, "anuncio-clicked-title"))
{
int duration = 30;
decimal value = 0m;
try
{
//