Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 1 | |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 3 | <html><head><title>Python: class Resource</title> |
| 4 | </head><body bgcolor="#f0f0f8"> |
| 5 | <p> |
| 6 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 7 | <tr bgcolor="#ffc8d8"> |
| 8 | <td colspan=3 valign=bottom> <br> |
| 9 | <font color="#000000" face="helvetica, arial"><a name="Resource">class <strong>Resource</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| 10 | |
| 11 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 12 | <td colspan=2><tt>A class for interacting with a resource.<br> </tt></td></tr> |
| 13 | <tr><td> </td> |
| 14 | <td width="100%">Methods defined here:<br> |
| 15 | <dl><dt><a name="Resource-__init__"><strong>__init__</strong></a>(self)</dt></dl> |
| 16 | |
| 17 | <dl><dt><a name="Resource-runpagespeed"><strong>runpagespeed</strong></a> = method(self, **kwargs)</dt><dd><tt>Runs Page Speed analysis on the page at the specified URL, and returns a Page Speed score, a list of suggestions to make that page faster, and other information.<br> |
| 18 | <br> |
| 19 | Args:<br> |
| 20 | locale: string, The locale used to localize formatted results<br> |
| 21 | rule: string, A Page Speed rule to run; if none are given, all rules are run (repeated)<br> |
| 22 | strategy: string, The analysis strategy to use<br> |
| 23 | Allowed values<br> |
| 24 | desktop - Fetch and analyze the URL for desktop browsers<br> |
| 25 | mobile - Fetch and analyze the URL for mobile devices<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame^] | 26 | url: string, The URL to fetch and analyze (required)<br> |
| 27 | <br> |
| 28 | Returns:<br> |
| 29 | An object of the form<br> |
| 30 | <br> |
| 31 | {<br> |
| 32 | "kind": "pagespeedonline#result", # Kind of result.<br> |
| 33 | "formattedResults": { # Localized Page Speed results. Contains a ruleResults entry for each Page Speed rule instantiated and run by the server.<br> |
| 34 | "locale": "A String", # The locale of the formattedResults, e.g. "en_US".<br> |
| 35 | "ruleResults": { # Dictionary of formatted rule results, with one entry for each Page Speed rule instantiated and run by the server.<br> |
| 36 | },<br> |
| 37 | },<br> |
| 38 | "title": "A String", # Title of the page, as displayed in the browser's title bar.<br> |
| 39 | "version": { # The version of the Page Speed SDK used to generate these results.<br> |
| 40 | "major": 42, # The major version number of the Page Speed SDK used to generate these results.<br> |
| 41 | "minor": 42, # The minor version number of the Page Speed SDK used to generate these results.<br> |
| 42 | },<br> |
| 43 | "score": 42, # The Page Speed Score (0-100), which indicates how much faster a page could be. A high score indicates little room for improvement, while a lower score indicates more room for improvement.<br> |
| 44 | "responseCode": 42, # Response code for the document. 200 indicates a normal page load. 4xx/5xx indicates an error.<br> |
| 45 | "invalidRules": [ # List of rules that were specified in the request, but which the server did not know how to instantiate.<br> |
| 46 | "A String",<br> |
| 47 | ],<br> |
| 48 | "pageStats": { # Summary statistics for the page, such as number of JavaScript bytes, number of HTML bytes, etc.<br> |
| 49 | "otherResponseBytes": "A String", # Number of response bytes for other resources on the page.<br> |
| 50 | "flashResponseBytes": "A String", # Number of response bytes for flash resources on the page.<br> |
| 51 | "totalRequestBytes": "A String", # Total size of all request bytes sent by the page.<br> |
| 52 | "numberCssResources": 42, # Number of CSS resources referenced by the page.<br> |
| 53 | "numberResources": 42, # Number of HTTP resources loaded by the page.<br> |
| 54 | "cssResponseBytes": "A String", # Number of uncompressed response bytes for CSS resources on the page.<br> |
| 55 | "javascriptResponseBytes": "A String", # Number of uncompressed response bytes for JS resources on the page.<br> |
| 56 | "imageResponseBytes": "A String", # Number of response bytes for image resources on the page.<br> |
| 57 | "numberHosts": 42, # Number of unique hosts referenced by the page.<br> |
| 58 | "numberStaticResources": 42, # Number of static (i.e. cacheable) resources on the page.<br> |
| 59 | "htmlResponseBytes": "A String", # Number of uncompressed response bytes for the main HTML document and all iframes on the page.<br> |
| 60 | "numberJsResources": 42, # Number of JavaScript resources referenced by the page.<br> |
| 61 | "textResponseBytes": "A String", # Number of uncompressed response bytes for text resources not covered by other statistics (i.e non-HTML, non-script, non-CSS resources) on the page.<br> |
| 62 | },<br> |
| 63 | "id": "A String", # Canonicalized and final URL for the document, after following page redirects (if any).<br> |
| 64 | }</tt></dd></dl> |
Joe Gregorio | b9e63ff | 2011-06-30 12:38:10 -0400 | [diff] [blame] | 65 | |
| 66 | <hr> |
| 67 | Data descriptors defined here:<br> |
| 68 | <dl><dt><strong>__dict__</strong></dt> |
| 69 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 70 | </dl> |
| 71 | <dl><dt><strong>__weakref__</strong></dt> |
| 72 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 73 | </dl> |
| 74 | </td></tr></table> |
| 75 | </body></html> |