Need a little help here and im sure this is easy for pro that using codecreator

prosperer888

Client
Регистрация
15.09.2011
Сообщения
157
Благодарностей
4
Баллы
18
I need some1 to help me with codecreator as i still learning using it :D

1) So im recording examples code(PHP) for login into youtube and i want to know how to get the email:pass from my file on my folder...for example in projectmaker im using {-File.GetString-|-\Results.txt-|-0-|-true-} and i also need to know how to split the email:password :confused:

2) After login into youtube i need to parsed some text(DOM) like exemples:
Код:
Get started by adding channels
3) How i supposed to save my email:pass to my file again :confused:

Sorry for my noob question.

Thanks in advance and i include the code that i record and hope some1 can help me by modified the code so that i will know where to edit the code :D

Код:
<?php
import namespace System;
import namespace Zennolab:::CommandCenter;

class Step1
{
	public static function Execute($instance)
	{
		// Clearing cookies
		$instance->ClearCookie();

		// Going to youtube.com
		$tb = $instance->MainTab;
		if (($tb->IsVoid) || ($tb->IsNull)) return -1;
		if ($tb->IsBusy) $tb->WaitDownloading();
		$tb->Navigate("youtube.com");
		if ($tb->IsBusy) $tb->WaitDownloading();

		// Click the link "Sign In"
		$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByAttribute("a", "href", "https://accounts.google.com/ServiceLogin\\?uilel=3&service=youtube&passive=true&continue=http%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26feature%3Dheader%26nomobiletemp%3D1%26hl%3Den_US%26next%3D%252F&hl=en_US&ltmpl=sso", "regexp", 0);
		if ($he->IsVoid) {
			$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByAttribute("a", "InnerText", "Sign\\ In", "regexp", 0);
		}
		if ($he->IsVoid) return -1;

		$he->RiseEvent("click", false);
		if ($tb->IsBusy) $tb->WaitDownloading();
		if ($instance->GetTabByAddress("popup")->IsBusy) $instance->GetTabByAddress("popup")->WaitDownloading();

		// Setting value [riroporge1...] to the element with tag [input:text]
		$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByName("Email");
		if ($he->IsVoid) {
			$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildById("Email");
		}
		if ($he->IsVoid) {
			$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByAttribute("input:text", "fulltag", "input:text", "text", 0);
		}
		if ($he->IsVoid) return -1;

		$he->SetValue("[email protected]", true);

		// Setting value [YGsxUFurtU] to the element with tag [input:password]
		$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByName("Passwd");
		if ($he->IsVoid) {
			$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildById("Passwd");
		}
		if ($he->IsVoid) {
			$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByAttribute("input:password", "fulltag", "input:password", "text", 0);
		}
		if ($he->IsVoid) return -1;

		$he->SetValue("YGsxUFurtU", true);

		// Branch builder, RiseEvent type
		$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByName("signIn");
		if ($he->IsVoid) return -1;

		$he->RiseEvent("click", true);
		if ($tb->IsBusy) $tb->WaitDownloading();
		if ($instance->GetTabByAddress("popup")->IsBusy) $instance->GetTabByAddress("popup")->WaitDownloading();
		return 0;
	}
}
?>
 

shade

Client
Регистрация
19.11.2010
Сообщения
580
Благодарностей
346
Баллы
63
I need some1 to help me with codecreator as i still learning using it :D

1) So im recording examples code(PHP) for login into youtube and i want to know how to get the email:pass from my file on my folder...for example in projectmaker im using {-File.GetString-|-\Results.txt-|-0-|-true-} and i also need to know how to split the email:password :confused:

2) After login into youtube i need to parsed some text(DOM) like exemples:
Код:
Get started by adding channels
3) How i supposed to save my email:pass to my file again :confused:

Sorry for my noob question.

Thanks in advance and i include the code that i record and hope some1 can help me by modified the code so that i will know where to edit the code :D

Код:
<?php
import namespace System;
import namespace Zennolab:::CommandCenter;

class Step1
{
    public static function Execute($instance)
    {
        // Clearing cookies
        $instance->ClearCookie();

        // Going to youtube.com
        $tb = $instance->MainTab;
        if (($tb->IsVoid) || ($tb->IsNull)) return -1;
        if ($tb->IsBusy) $tb->WaitDownloading();
        $tb->Navigate("youtube.com");
        if ($tb->IsBusy) $tb->WaitDownloading();

        // Click the link "Sign In"
        $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByAttribute("a", "href", "https://accounts.google.com/ServiceLogin\\?uilel=3&service=youtube&passive=true&continue=http%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26feature%3Dheader%26nomobiletemp%3D1%26hl%3Den_US%26next%3D%2F&hl=en_US&ltmpl=sso", "regexp", 0);
        if ($he->IsVoid) {
            $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByAttribute("a", "InnerText", "Sign\\ In", "regexp", 0);
        }
        if ($he->IsVoid) return -1;

        $he->RiseEvent("click", false);
        if ($tb->IsBusy) $tb->WaitDownloading();
        if ($instance->GetTabByAddress("popup")->IsBusy) $instance->GetTabByAddress("popup")->WaitDownloading();

        // Setting value [riroporge1...] to the element with tag [input:text]
        $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByName("Email");
        if ($he->IsVoid) {
            $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildById("Email");
        }
        if ($he->IsVoid) {
            $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByAttribute("input:text", "fulltag", "input:text", "text", 0);
        }
        if ($he->IsVoid) return -1;

        $he->SetValue("[email protected]", true);

        // Setting value [YGsxUFurtU] to the element with tag [input:password]
        $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByName("Passwd");
        if ($he->IsVoid) {
            $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildById("Passwd");
        }
        if ($he->IsVoid) {
            $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByAttribute("input:password", "fulltag", "input:password", "text", 0);
        }
        if ($he->IsVoid) return -1;

        $he->SetValue("YGsxUFurtU", true);

        // Branch builder, RiseEvent type
        $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByName("signIn");
        if ($he->IsVoid) return -1;

        $he->RiseEvent("click", true);
        if ($tb->IsBusy) $tb->WaitDownloading();
        if ($instance->GetTabByAddress("popup")->IsBusy) $instance->GetTabByAddress("popup")->WaitDownloading();
        return 0;
    }
}
?>
PHP:
<?php
import namespace System;
import namespace Zennolab:::CommandCenter;

class Step1
{
    public static function Execute($instance)
    {
        // clear cookie
        $instance->ClearCookie();

        // go to youtube.com
        $tb = $instance->MainTab;
        if (($tb->IsVoid) || ($tb->IsNull)) return -1;
        if ($tb->IsBusy) $tb->WaitDownloading();
        $tb->Navigate("youtube.com");
        if ($tb->IsBusy) $tb->WaitDownloading();

        // Click the link "Sign In"
        $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByAttribute("a", "href", "https://accounts.google.com/ServiceLogin\\?uilel=3&service=youtube&passive=true&continue=http%3A%2F%2Fwww.youtube.com%2Fsignin%3Faction_handle_signin%3Dtrue%26feature%3Dheader%26nomobiletemp%3D1%26hl%3Dru_RU%26next%3D%2F&hl=ru_RU&ltmpl=sso", "regexp", 0);
        if ($he->IsVoid) {
            $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByAttribute("a", "InnerText", "Sign\\ In", "regexp", 0);
        }
        if ($he->IsVoid) return -1;

        $he->RiseEvent("click", false);
        if ($tb->IsBusy) $tb->WaitDownloading();
        if ($instance->GetTabByAddress("popup")->IsBusy) $instance->GetTabByAddress("popup")->WaitDownloading();
        
        // get random string from file
        // it's string in format email:password
        $email_password = $instance->RiseMacros("File.GetString", array( "\\Resources\\textfile.txt", "random", "true" ));
        
        // split string email:password and get email
        $email = $instance->RiseMacros("String.Split", array( $email_password, ":", "0" ));
        
        // split string email:password and get password
        $password = $instance->RiseMacros("String.Split", array( $email_password, ":", "1" ));
        
        // set email into field for email
        $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByName("Email");
        if ($he->IsVoid) {
            $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildById("Email");
        }
        if ($he->IsVoid) {
            $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByAttribute("input:text", "fulltag", "input:text", "text", 0);
        }
        if ($he->IsVoid) return -1;
        
        $he->SetValue($email, true);

        // set password into field for password
        $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByName("Passwd");
        if ($he->IsVoid) {
            $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildById("Passwd");
        }
        if ($he->IsVoid) {
            $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByAttribute("input:password", "fulltag", "input:password", "text", 0);
        }
        if ($he->IsVoid) return -1;

        $he->SetValue($password, true);

        // sign in
        $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByName("signIn");
        if ($he->IsVoid) {
            $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildById("signIn");
        }
        if ($he->IsVoid) {
            $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByAttribute("input:submit", "fulltag", "input:submit", "text", 0);
        }
        if ($he->IsVoid) return -1;

        $he->RiseEvent("click", false);
        if ($tb->IsBusy) $tb->WaitDownloading();
        if ($instance->GetTabByAddress("popup")->IsBusy) $instance->GetTabByAddress("popup")->WaitDownloading();
        
        // save email:password to file
        $instance->RiseMacros("File.AppendString", array( "\\Results\\result.txt", $email.":".$password, "true" ));
        
        // serch text
        $exist = strstr($instance->MainTab->DomText, "Get started by adding channels");
        if ($exist != false)
        {
             // if the text exist
        }
        else 
        {
            // if the text does not exist
        } 
        
        return 0;
    }
}
?>
 
  • Спасибо
Реакции: prosperer888

prosperer888

Client
Регистрация
15.09.2011
Сообщения
157
Благодарностей
4
Баллы
18
Thanks shade :-) you rock bro :az:

emm i forget 1 thing...let says i enter wrong captcha and i want to parsed this text

"Please try again"

and start fill the form again how can i do that....

Let takes the code that you provide above for example :-)

i fill the email and password and the click login and the account already been delete and i want to parsed this text

Код:
The username or password you entered is incorrect
so how i can start again from insert email and password if the parsed text is exist...and if the parsed text didn't exist the code will continue until it finish..

i think i need to edit this code below but i not sure what to put in

PHP:
// serch text
        $exist = strstr($instance->MainTab->DomText, "The username or password you entered is incorrect");
        if ($exist != false)
        {
             // if the text exist
        }
        else 
        {
            // if the text does not exist
        }
 

prosperer888

Client
Регистрация
15.09.2011
Сообщения
157
Благодарностей
4
Баллы
18
Anyone can help me with this :confused:
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113
There are two ways
1. you put this code that has to be executed once again in a separate function. And call function 2 times in your code.
2. you just copy/paste that.
 

prosperer888

Client
Регистрация
15.09.2011
Сообщения
157
Благодарностей
4
Баллы
18
where should i put or copy paste the code? maybe some example please on how the code should look after i copy/paste the code ;-)

should i put the code in the "// if the text exist" and "// if the text does not exist" area (please do some example with the code above :-) )?

and how can i use code like "{-FieldData.FieldData-|-asdasdasd-}"=="" in projectmaker and use it on codecreator? i think i should edit this line

if ($exist != false)
and edit it to
if ($exist == false)

but i not sure if it correct or not and where should the "=="" goes to i mean the "

thanks in advance :-)
 

prosperer888

Client
Регистрация
15.09.2011
Сообщения
157
Благодарностей
4
Баллы
18
sorry for all my question :-) i just learning to used code creator :-) all the question above i know how to do it in projectmaker and now i want to learn how to use codecreator hope some pro can help me :-)
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113
It is better to start learning programming basic then. Since there it is explained very clear. But I'd reccomend to use C# :-)
 

prosperer888

Client
Регистрация
15.09.2011
Сообщения
157
Благодарностей
4
Баллы
18
So i just waste my time for 2 week try to learn it and i already know a little then you suggest me to go learn something new again it will make me going crazy with all new code....all i ask is an simple examples for how to enter captcha again if i enter the 1st 1 wrong :(
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113
where should i put or copy paste the code? maybe some example please on how the code should look after i copy/paste the code ;-)

should i put the code in the "// if the text exist" and "// if the text does not exist" area (please do some example with the code above :-) )?

and how can i use code like "{-FieldData.FieldData-|-asdasdasd-}"=="" in projectmaker and use it on codecreator? i think i should edit this line

if ($exist != false)
and edit it to
if ($exist == false)

but i not sure if it correct or not and where should the "=="" goes to i mean the "

thanks in advance :-)
You should copy code of captcha processing- seatching of element, recognition, seraching field for captcha input, enter of value and paste it to a part when captcha entered wrong.

PHP:
 if ($exist != false)
        {
             // HERE
        }
"{-FieldData.FieldData-|-asdasdasd-}" such things don't work at all with CodeCreator. You should call functions, use variables and don't use macro in old form.
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)