// googlepage private static void googlepage_50_0(DataContext _datacontext, LocalVariables _parameters) { ExtractionListBase <Result> items = (ExtractionListBase <Result>)_parameters["items"]; ScopesStack __l = new ScopesStack(_datacontext, null); { foreach (var __fe52_4 in ForeachMethods.xmlmatch(__l.context, "\r\n <h3 class=\"r\">\r\n <a href=\"~@rhref@~\" class=\"l\">~@rtitle@~</a>\r\n </h3>\r\n ")) { __l.Push(null, __fe52_4); { items.AddElement((new Result() { url = htmldecode_23_0((__l["rhref"].ToString())), title = (__l["rtitle"].ToString()) })); } __l.Pop(); } foreach (var __fe61_4 in ForeachMethods.xmlmatch(__l.context, "<a href=\"~@rhref@~\"><span class=\"csb ch\" style=\"background-position:-76px 0;margin-right:34px;width:66px\" />Next</a>")) { __l.Push(null, __fe61_4); { __l.Push(__l.context.OpenContextDynamic("open", new object[] { htmldecode_23_0((__l["rhref"].ToString())) }), null); ActionItem.AddAction(new ActionItem.ExtractionMethod[] { googlepage_50_0 }, __l.context, new LocalVariables() { { "items", items } }.SetCannotAddAction(new Dictionary <string, bool>() { { "items", _parameters.CannotAddActionForVariable("items") } })); __l.Pop(); } __l.Pop(); } } }
// main private static void main_40_0(DataContext _datacontext, LocalVariables _parameters) { ExtractionListBase <Result> GoogleResults = (ExtractionListBase <Result>)_parameters["GoogleResults"]; QueryState state = (QueryState)_parameters["state"]; string searchQuery = (string)_parameters["searchQuery"]; ScopesStack __l = new ScopesStack(_datacontext, null); { { __l.Push(__l.context.OpenContextDynamic("open", new object[] { (("http://www.google.com/search?hl=en&q=") + (urlencode_20_0(searchQuery))) }), null); ActionItem.AddAction(new ActionItem.ExtractionMethod[] { googlepage_50_0 }, __l.context, new LocalVariables() { { "items", GoogleResults } }.SetCannotAddAction(new Dictionary <string, bool>() { { "items", _parameters.CannotAddActionForVariable("GoogleResults") } })); ActionItem.AddAction(new ActionItem.ExtractionMethod[] { searchinfo_65_0 }, __l.context, new LocalVariables() { { "state", state } }.SetCannotAddAction(new Dictionary <string, bool>() { { "state", _parameters.CannotAddActionForVariable("state") } })); __l.Pop(); } } }
// searchinfo private static void searchinfo_65_0(DataContext _datacontext, LocalVariables _parameters) { QueryState state = (QueryState)_parameters["state"]; ScopesStack __l = new ScopesStack(_datacontext, null); { foreach (var __fe67_4 in ForeachMethods.match(__l.context, "<p id=resultStats> ~@strstat@~ </div>")) { __l.Push(null, __fe67_4); state.info = (__l["strstat"].ToString()); __l.Pop(); } } }
/// <summary> /// Used to create derived scope (with access to all root variables) /// </summary> /// <param name="errorHandler"></param> /// <param name="rootScope"></param> protected GlobalScope(IErrorHandler errorHandler, GlobalScope rootScope) { _errorHandler = errorHandler; ScopesStack.Push(rootScope.GetBoottomScope()); }