public static string PostQuestionAskCom(string Email, string Password, string Topic, string Proxy, string Macro)
        {
            // GET iMacros code
            // SET Variables
            // Execute the code
            // Return Success / Failure
            //bool Success = false;

            string QuestionLink = "";

            m_app = new iMacros.App();
            iMacros.Status s;

            s = m_app.iimOpen("", true, 5);

            s = m_app.iimSet("Email", Email);
            s = m_app.iimSet("Password", Password);
            s = m_app.iimSet("Proxy", Proxy);
            s = m_app.iimSet("Topic", Topic);

            // Execute macro
            s = m_app.iimPlayCode(Macro, m_timeout);

            try
            {
                QuestionLink = m_app.iimGetExtract(1);
            }
            catch
            {
                goto Continue1;
            }

Continue1:

            try
            {
                s = m_app.iimClose(close_timeout);
            }
            catch
            {
                //
                goto JustContinue;
            }

JustContinue:

            m_app = null;

            // Get variable from macro and return


            // *************************************************
            //Success = true; // TEMPORARY VALUE for DEBUGGING
            // *************************************************

            return(QuestionLink);
        }
        public string ImacrosTinyurlConvert(string longurl)
        {
            string shorturl = "";

        ShortenAgain:
            iMacros.App m_app = new iMacros.App();
            iMacros.Status s;

            string macro = GetTinyURLmacro();

            s = m_app.iimOpen("", true, 5);
            s = m_app.iimSet("Longurl", longurl);
            // Execute macro
            s = m_app.iimPlayCode(macro, m_timeout);

            try
            {
                shorturl = m_app.iimGetExtract(1);
            }
            catch
            {
                //
                goto ShortenAgain;
            }

            try
            {
                s = m_app.iimClose(close_timeout);
            }
            catch
            {
                // 
                goto JustContinue;
            }

        JustContinue:

            m_app = null;

            // Get variable from macro and return


            return shorturl;
        }
Exemple #3
0
        public string ImacrosTinyurlConvert(string longurl)
        {
            string shorturl = "";

ShortenAgain:
            iMacros.App m_app = new iMacros.App();
            iMacros.Status s;

            string macro = GetTinyURLmacro();

            s = m_app.iimOpen("", true, 5);
            s = m_app.iimSet("Longurl", longurl);
            // Execute macro
            s = m_app.iimPlayCode(macro, m_timeout);

            try
            {
                shorturl = m_app.iimGetExtract(1);
            }
            catch
            {
                //
                goto ShortenAgain;
            }

            try
            {
                s = m_app.iimClose(close_timeout);
            }
            catch
            {
                //
                goto JustContinue;
            }

JustContinue:

            m_app = null;

            // Get variable from macro and return


            return(shorturl);
        }
        public static bool CreateAccountPurseBlog(string username, string email, string pwd, string fname, string proxy, string CreateMacro)
        {
            // STANDARD VARIABLES
            String result = "";
            int    errors = 0;

            string ConfirmationTxt = "";
            int    inc             = 0;
            bool   Success         = false;

            if (email != "")
            {
                m_app = new iMacros.App();
                iMacros.Status s;

TryAgain:
                try
                {
                    s = m_app.iimOpen("", true, m_timeout);
                    if (s != iMacros.Status.sOk)
                    {
                        errors++;
                    }
                    result = result + "open " + Convert.ToString(s) + "; ";

                    s = m_app.iimSet("Username", username);
                    if (s != iMacros.Status.sOk)
                    {
                        errors++;
                    }
                    result = result + "set " + Convert.ToString(s) + "; ";

                    s = m_app.iimSet("Email", email);
                    if (s != iMacros.Status.sOk)
                    {
                        errors++;
                    }
                    result = result + "set " + Convert.ToString(s) + "; ";

                    s = m_app.iimSet("Password", pwd);
                    if (s != iMacros.Status.sOk)
                    {
                        errors++;
                    }
                    result = result + "set " + Convert.ToString(s) + "; ";

                    s = m_app.iimSet("FirstName", fname);
                    if (s != iMacros.Status.sOk)
                    {
                        errors++;
                    }
                    result = result + "set " + Convert.ToString(s) + "; ";

                    s = m_app.iimSet("Proxy", proxy);
                    if (s != iMacros.Status.sOk)
                    {
                        errors++;
                    }
                    result = result + "set " + Convert.ToString(s) + "; ";

                    // Execute macro
                    s = m_app.iimPlayCode(CreateMacro, m_timeout);
                    if (s != iMacros.Status.sOk)
                    {
                        errors++;
                    }
                    result = result + "play " + Convert.ToString(s) + "; ";

                    ConfirmationTxt = m_app.iimGetExtract(1);
                }
                catch
                {
                    MessageBox.Show("Result: " + result);
                    goto TryAgain;
                }

                string[] testsplit = ConfirmationTxt.Split(' ');

                if (ConfirmationTxt != "" && ConfirmationTxt != "NODATA" && ConfirmationTxt != "#EANF#" && testsplit.Count() >= 7)
                {
                    string FinishCreateMacro = "";

                    FinishCreateMacro = FinishCreateMacro + "WAIT SECONDS=3" + "\n";
                    FinishCreateMacro = FinishCreateMacro + "TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:register ATTR=NAME:humanverify[input] CONTENT={{Solution}}" + "\n";
                    FinishCreateMacro = FinishCreateMacro + "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:register ATTR=NAME:options[adminemail] CONTENT=NO" + "\n";
                    FinishCreateMacro = FinishCreateMacro + "WAIT SECONDS=3" + "\n";
                    FinishCreateMacro = FinishCreateMacro + "TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:register ATTR=CLASS:button" + "\n";
                    FinishCreateMacro = FinishCreateMacro + "WAIT SECONDS=3" + "\n";

                    s = m_app.iimSet("Solution", SolveCaptchaPurseBlog(ConfirmationTxt));
                    s = m_app.iimPlayCode(FinishCreateMacro, m_timeout);

                    Success = true; // TEMPORARY VALUE for DEBUGGING
                }
                else
                {
                    inc++;
                    if (inc > 5)
                    {
                        Success = false;
                        goto CloseApp;
                    }
                    s     = m_app.iimClose();
                    m_app = null;
                    goto TryAgain;
                }

CloseApp:
                try
                {
                    s = m_app.iimClose(close_timeout);
                }
                catch
                {
                    //
                    goto JustContinue;
                }

JustContinue:

                m_app = null;

                // Get variable from macro and return
            }


            // *************************************************
            // *************************************************

            return(Success);
        }
        public static string[] CreateAccountAskCom(string username, string email, string pwd, string fname, string proxy, string CreateMacro, string topic)
        {
            // READ iMacros Code
            // SET variables
            // Execute the code
            // Return success / failure --> Save to DB??

            //bool Success = false;

            string[] ErrAndId = new string[2];

            // tblaccts.Filter = Projects.ColumnNames.Id + " = " + nextemail;
            if (topic != "")
            {
TryAgain:
                m_app = new iMacros.App();
                iMacros.Status s;

                s = m_app.iimOpen("", true, m_timeout);
                s = m_app.iimSet("Username", username);
                s = m_app.iimSet("Email", email);
                s = m_app.iimSet("Password", pwd);
                s = m_app.iimSet("FirstName", fname);
                s = m_app.iimSet("Proxy", proxy);
                s = m_app.iimSet("Topic", topic);

                // Execute macro
                s = m_app.iimPlayCode(CreateMacro, m_timeout);
                try
                {
                    ErrAndId[1] = m_app.iimGetExtract(1);
                    ErrAndId[0] = m_app.iimGetExtract(2);
                }
                catch
                {
                    //
                    goto TryAgain;
                }

                // Success = m_app.iimGetExtract(1);
                try
                {
                    s = m_app.iimClose(close_timeout);
                }
                catch
                {
                    //
                    goto JustContinue;
                }

JustContinue:

                m_app = null;

                // Get variable from macro and return
            }


            // *************************************************
            //Success = true; // TEMPORARY VALUE for DEBUGGING
            // *************************************************

            return(ErrAndId);
        }
        public static bool CreateAccountPurseBlog(string username, string email, string pwd, string fname, string proxy, string CreateMacro)
        {

            // STANDARD VARIABLES
            String result = "";
            int errors = 0;

            string ConfirmationTxt = "";
            int inc = 0;
            bool Success = false;
            if (email != "")
            {

                m_app = new iMacros.App();
                iMacros.Status s;
            
            TryAgain:
                try
                {
                    s = m_app.iimOpen("", true, m_timeout);
                    if (s != iMacros.Status.sOk) errors++;
                    result = result + "open " + Convert.ToString(s) + "; ";

                    s = m_app.iimSet("Username", username);
                    if (s != iMacros.Status.sOk) errors++;
                    result = result + "set " + Convert.ToString(s) + "; ";

                    s = m_app.iimSet("Email", email);
                    if (s != iMacros.Status.sOk) errors++;
                    result = result + "set " + Convert.ToString(s) + "; ";

                    s = m_app.iimSet("Password", pwd);
                    if (s != iMacros.Status.sOk) errors++;
                    result = result + "set " + Convert.ToString(s) + "; ";

                    s = m_app.iimSet("FirstName", fname);
                    if (s != iMacros.Status.sOk) errors++;
                    result = result + "set " + Convert.ToString(s) + "; ";

                    s = m_app.iimSet("Proxy", proxy);
                    if (s != iMacros.Status.sOk) errors++;
                    result = result + "set " + Convert.ToString(s) + "; ";

                    // Execute macro
                    s = m_app.iimPlayCode(CreateMacro, m_timeout);
                    if (s != iMacros.Status.sOk) errors++;
                    result = result + "play " + Convert.ToString(s) + "; ";

                    ConfirmationTxt = m_app.iimGetExtract(1);

                }
                catch
                {
                    MessageBox.Show("Result: " + result);
                    goto TryAgain;
                }
                
                string[] testsplit = ConfirmationTxt.Split(' ');
                
                if (ConfirmationTxt != "" && ConfirmationTxt != "NODATA" && ConfirmationTxt != "#EANF#" && testsplit.Count() >= 7)
                {
                    string FinishCreateMacro = "";
                
                    FinishCreateMacro = FinishCreateMacro + "WAIT SECONDS=3" + "\n";
                    FinishCreateMacro = FinishCreateMacro + "TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:register ATTR=NAME:humanverify[input] CONTENT={{Solution}}" + "\n";
                    FinishCreateMacro = FinishCreateMacro + "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:register ATTR=NAME:options[adminemail] CONTENT=NO" + "\n";
                    FinishCreateMacro = FinishCreateMacro + "WAIT SECONDS=3" + "\n";
                    FinishCreateMacro = FinishCreateMacro + "TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:register ATTR=CLASS:button" + "\n";
                    FinishCreateMacro = FinishCreateMacro + "WAIT SECONDS=3" + "\n";

                    s = m_app.iimSet("Solution", SolveCaptchaPurseBlog(ConfirmationTxt));
                    s = m_app.iimPlayCode(FinishCreateMacro, m_timeout);

                    Success = true; // TEMPORARY VALUE for DEBUGGING 
                
                }
                else
                {
                    inc++;
                    if (inc > 5)
                    {
                        Success = false; 
                        goto CloseApp;
                    }
                    s = m_app.iimClose();
                    m_app = null;
                    goto TryAgain;
                }

            CloseApp:
                try
                {
                    s = m_app.iimClose(close_timeout);
                }
                catch
                {
                    // 
                    goto JustContinue;
                }

            JustContinue:

                m_app = null;

                // Get variable from macro and return
            }


            // *************************************************
            // *************************************************

            return Success;
        }
        public static string PostQuestionAskCom(string Email, string Password, string Topic, string Proxy, string Macro)
        {
                        // GET iMacros code
            // SET Variables
            // Execute the code
            // Return Success / Failure
            //bool Success = false;

            string QuestionLink = "";
            
            m_app = new iMacros.App();
            iMacros.Status s;

            s = m_app.iimOpen("", true, 5);

            s = m_app.iimSet("Email", Email);
            s = m_app.iimSet("Password", Password);
            s = m_app.iimSet("Proxy", Proxy);
            s = m_app.iimSet("Topic", Topic);

            // Execute macro
            s = m_app.iimPlayCode(Macro, m_timeout);

            try
            {
                QuestionLink = m_app.iimGetExtract(1);
            }
            catch
            {
                goto Continue1;
            }

        Continue1:

            try
            {
                s = m_app.iimClose(close_timeout);
            }
            catch
            {
                // 
                goto JustContinue;
            }

        JustContinue:

            m_app = null;

            // Get variable from macro and return
            
            
        // *************************************************
        //Success = true; // TEMPORARY VALUE for DEBUGGING 
        // *************************************************

            return QuestionLink;
             
        }
        public static string[] CreateAccountAskCom(string username, string email, string pwd, string fname, string proxy, string CreateMacro, string topic)
        {
            // READ iMacros Code
            // SET variables
            // Execute the code
            // Return success / failure --> Save to DB??

            //bool Success = false;

            string[] ErrAndId = new string[2];

            // tblaccts.Filter = Projects.ColumnNames.Id + " = " + nextemail;
            if (topic != "")
            {

            TryAgain:
                m_app = new iMacros.App();
                iMacros.Status s;

                s = m_app.iimOpen("", true, m_timeout);
                s = m_app.iimSet("Username", username);
                s = m_app.iimSet("Email", email);
                s = m_app.iimSet("Password", pwd);
                s = m_app.iimSet("FirstName", fname);
                s = m_app.iimSet("Proxy", proxy);
                s = m_app.iimSet("Topic", topic);
                
                // Execute macro
                s = m_app.iimPlayCode(CreateMacro, m_timeout);
                try
                {
                    ErrAndId[1] = m_app.iimGetExtract(1);
                    ErrAndId[0] = m_app.iimGetExtract(2);
                }
                catch
                {
                    //
                    goto TryAgain;
                }

                // Success = m_app.iimGetExtract(1);
                try
                {
                    s = m_app.iimClose(close_timeout);
                }
                catch
                {
                    // 
                    goto JustContinue;
                }

            JustContinue:

                m_app = null;

                // Get variable from macro and return
            }


            // *************************************************
            //Success = true; // TEMPORARY VALUE for DEBUGGING 
            // *************************************************

            return ErrAndId;
        }
Exemple #9
0
        public string[] CreateAccountWithCaptcha(Emailaccounts tblaccouts, string proxy, string CreateMacro)
        {
            string[] ErrAndId = new string[2];

            Dictionary <string, string> props = ParseProperties(tblaccouts.Allproperties);

            iMacros.App    m_app = new iMacros.App();
            iMacros.Status s     = new iMacros.Status();
            s = m_app.iimOpen("", true, m_timeout);

            /*
             * s = m_app.iimSet("Username", username);
             * s = m_app.iimSet("Email", email);
             * s = m_app.iimSet("Password", pwd);
             * s = m_app.iimSet("FirstName", fname);
             * s = m_app.iimSet("Proxy", proxy);
             * s = m_app.iimSet("Topic", topic);
             */

            // s = m_app.iimSet("Topic", topic);

            s = m_app.iimSet("Username", tblaccouts.Username);
            s = m_app.iimSet("Email", tblaccouts.Email);
            s = m_app.iimSet("Password", tblaccouts.Password);
            s = m_app.iimSet("FirstName", tblaccouts.FirstName);
            s = m_app.iimSet("LastName", tblaccouts.LastName);

            s = m_app.iimSet("BirthdayYYYYMMDD", tblaccouts.Birthday.ToString("yyyy-MM-dd"));
            s = m_app.iimSet("BirthdayDDMMYYYY", tblaccouts.Birthday.ToString("dd/MM/yyyy"));
            s = m_app.iimSet("BirthdayYYYY", tblaccouts.Birthday.ToString("yyyy"));
            s = m_app.iimSet("BirthdayYY", tblaccouts.Birthday.ToString("yy"));
            s = m_app.iimSet("BirthdayMM", tblaccouts.Birthday.ToString("MM"));
            s = m_app.iimSet("BirthdayMMM", tblaccouts.Birthday.ToString("MMM"));
            s = m_app.iimSet("BirthdayM", tblaccouts.Birthday.ToString("M"));
            s = m_app.iimSet("BirthdayDD", tblaccouts.Birthday.ToString("dd"));

            // FRENCH FORUMS:
            s = m_app.iimSet("StreetFR", tblaccouts.StreetFR);
            s = m_app.iimSet("PostalCodeFR", tblaccouts.PostalCodeFR);
            s = m_app.iimSet("CityFR", tblaccouts.CityFR);

            // AU and US:
            s = m_app.iimSet("PostalCodeAU", tblaccouts.PostalCodeAU);
            s = m_app.iimSet("PostalCodeUS", tblaccouts.PostalCodeFR);
            s = m_app.iimSet("PostalCodeDE", tblaccouts.PostalCodeDE);

            s = m_app.iimSet("Proxy", proxy);

            foreach (KeyValuePair <string, string> property in props)
            {
                s = m_app.iimSet(property.Key, property.Value);
            }


            // Execute macro
            s = m_app.iimPlayCode(CreateMacro, m_timeout);
            try
            {
                ErrAndId[1] = m_app.iimGetExtract(1);
                ErrAndId[0] = m_app.iimGetExtract(2);
            }
            catch
            {
            }

            try
            {
                s = m_app.iimClose(close_timeout);
            }
            catch
            {
                //
                goto JustContinue;
            }
JustContinue:
            m_app = null;

            return(ErrAndId);
        }
Exemple #10
0
        public iMacrosPostReturnVars LoginAndPost(string Username, string Email, string Password, string Proxy, string LinkToPost, string GeneratedResponse, string macro)
        {
            string macrocheckifposted         = "";
            iMacrosPostReturnVars localposter = new iMacrosPostReturnVars();

            macrocheckifposted = getCheckifpostedmacro();

            iMacros.App    m_app = new iMacros.App();
            iMacros.Status s     = new iMacros.Status();

            s = m_app.iimOpen("", true, 5);
            s = m_app.iimSet("Username", Username);
            s = m_app.iimSet("Email", Email);
            s = m_app.iimSet("Password", Password);
            s = m_app.iimSet("Proxy", Proxy);
            s = m_app.iimSet("LinkToPost", LinkToPost);
            s = m_app.iimSet("Answer", GeneratedResponse);

            // Execute macro
            s = m_app.iimPlayCode(macro, m_timeout);

            string          pattern = @"http://.+/";
            Regex           rgx     = new Regex(pattern, RegexOptions.IgnoreCase);
            MatchCollection matches = rgx.Matches(GeneratedResponse);

            if (matches.Count > 0)
            {
                foreach (Match match in matches)
                {
                    s = m_app.iimSet("Shortener", match.Value);
                }
            }
            else
            {
                s = m_app.iimSet("Shortener", "http://eurl.me/");
            }

            s = m_app.iimPlayCode(macrocheckifposted, m_timeout);
            if (m_app.iimGetExtract(1) != "#EANF#" && m_app.iimGetExtract(1) != "NODATA")
            {
                localposter.setSuccess(true);
            }
            else
            {
                localposter.setSuccess(false);
            }

            if (m_app.iimGetExtract(2) != "NODATA")
            {
                localposter.setReturnURL(m_app.iimGetExtract(2));
            }

            try
            {
                s = m_app.iimClose(close_timeout);
            }
            catch
            {
                //
                goto JustContinue;
            }

JustContinue:
            m_app = null;

            return(localposter);
        }