Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
public:codein:activity_extractor_technical_docs [2016/12/19 00:52]
manveer_b Finished off initial page
public:codein:activity_extractor_technical_docs [2016/12/24 03:47]
manveer_b
Line 14: Line 14:
     '​email':​ self.email,     '​email':​ self.email,
     '​password':​ self.password,​     '​password':​ self.password,​
-    '​chrome_args':​ self.chrome_args,​ 
     '​user':​ self.user     '​user':​ self.user
   }   }
Line 21: Line 20:
 email: The email required to log into the service.\\ email: The email required to log into the service.\\
 password: The password associated with the email.\\ password: The password associated with the email.\\
-chrome_args:​ Potential arguments that can be used when initializing the chromedriver.\\ 
 user: //(Only required for Netflix)// The profile name the user wishes to retrieve viewing activity from.\\ user: //(Only required for Netflix)// The profile name the user wishes to retrieve viewing activity from.\\
  
 ==== common.py ==== ==== common.py ====
 Contains modules common to all services. Contains modules common to all services.
-== > outputActivity(SERVICE, activity_list) ==+== > output_activity(SERVICE, activity_list) ==
 Module to output activity into a .txt file.\\ Module to output activity into a .txt file.\\
 \\ \\
Line 35: Line 33:
 ==== hulu.py ==== ==== hulu.py ====
 Gets viewing activity from Hulu. Gets viewing activity from Hulu.
-== > getActivity() == +== > get_activity() == 
-Called from the Main Module. It's main purpose is to initialize the process and call loginHulu() +Called from the Main Module. It's main purpose is to initialize the process and call login_hulu() 
-== > loginHulu() ==+== > login_hulu() ==
 First this function creates an instance of Chrome and passes potential arguments to the driver.\\ First this function creates an instance of Chrome and passes potential arguments to the driver.\\
-It then navigates to www.hulu.com and logs in with the user credentials. Then calls navigateSite() +It then navigates to www.hulu.com and logs in with the user credentials. Then calls navigate_site() 
-== > navigateSite() ==+== > navigate_site() ==
 The main purpose of this function is to navigate to the '​History'​ page on Hulu. The main purpose of this function is to navigate to the '​History'​ page on Hulu.
-== > navigatePages() ==+== > navigate_pages() ==
 Depending on the length of the user's viewing history there may be multiple pages of viewing history.\\ Depending on the length of the user's viewing history there may be multiple pages of viewing history.\\
-This function calls getPageActivity() for every page of viewing history. Then calls common.outputActivity().\\ +This function calls get_page_activity() for every page of viewing history. Then calls common.output_activity().\\ 
-== > getPageActivity() ==+== > get_page_activity() ==
 Gets all the viewing activity on the current viewing history page. Also displays a progress bar to the user.\\ Gets all the viewing activity on the current viewing history page. Also displays a progress bar to the user.\\
  
 ==== amazon.py ==== ==== amazon.py ====
 Gets viewing activity from Amazon. Gets viewing activity from Amazon.
-== > getActivity() == +== > get_activity() == 
-Called from the Main Module. It's main purpose is to initialize the process and call loginAmazon() +Called from the Main Module. It's main purpose is to initialize the process and call login_amazon() 
-== > loginAmazon() ==+== > login_amazon() ==
 First this function creates an instance of Chrome and passes potential arguments to the driver.\\ First this function creates an instance of Chrome and passes potential arguments to the driver.\\
-It then navigates to https://​www.amazon.com/​gp/​sign-in.html and logs in with the user credentials. It then navigates to the viewing history page by passing a url to the driver. Calls navigatePages() +It then navigates to https://​www.amazon.com/​gp/​sign-in.html and logs in with the user credentials. It then navigates to the viewing history page by passing a url to the driver. Calls navigate_pages() 
-== > navigatePages() ==+== > navigate_pages() ==
 Depending on the length of the user's viewing history there may be multiple pages of viewing history.\\ Depending on the length of the user's viewing history there may be multiple pages of viewing history.\\
-This function calls getPageActivity() for every page of viewing history. Then calls common.outputActivity().\\ +This function calls get_page_activity() for every page of viewing history. Then calls common.output_activity().\\ 
-== > getPageActivity() ==+== > get_page_activity() ==
 Gets all the viewing activity on the current viewing history page.\\ Gets all the viewing activity on the current viewing history page.\\
  
 ==== netflix.py ==== ==== netflix.py ====
 Gets viewing activity from Netflix. Gets viewing activity from Netflix.
-== > getActivity() == +== > get_activity() == 
-Called from the Main Module. It's main purpose is to initialize the process and call loginNetflix() +Called from the Main Module. It's main purpose is to initialize the process and call login_netflix() 
-== > loginAmazon() ==+== > login_amazon() ==
 First this function creates an instance of Chrome and passes potential arguments to the driver.\\ First this function creates an instance of Chrome and passes potential arguments to the driver.\\
-It then navigates to https://​www.netflix.com/​Login and logs in with the user credentials. It then calls getActiveProfile() +It then navigates to https://​www.netflix.com/​Login and logs in with the user credentials. It then calls get_active_profile() 
-== > getActiveProfile() == +== > get_active_profile() == 
-Selects user profile based on profile name present in parameters['​user'​]. Calls navigateSite() +Selects user profile based on profile name present in parameters['​user'​]. Calls navigate_site() 
-== > navigateSite() == +== > navigate_site() == 
-Calls hoverClick() then clicks the '​Viewing Activity'​ link once hoverClick() has navigated to the user's account page. Then calls scrollToBottom() +Calls hover_click() then clicks the '​Viewing Activity'​ link once hover_click() has navigated to the user's account page. Then calls scroll_to_bottom() 
-== > hoverClick() ==+== > hover_click() ==
 Hovers on the profile icon in the top right corner of the Netflix homepage. Then clicks on 'Your Account'​ on the dropdown menu that appears. Returns True or False depending on whether the process was successful. Hovers on the profile icon in the top right corner of the Netflix homepage. Then clicks on 'Your Account'​ on the dropdown menu that appears. Returns True or False depending on whether the process was successful.
-== > scrollToBottom() ==+== > scroll_to_bottom() ==
 Depending on the length of the user's viewing activity Netflix displays only a portion of it. In order to have Netflix display the full list this function is called.\\ Depending on the length of the user's viewing activity Netflix displays only a portion of it. In order to have Netflix display the full list this function is called.\\
-Scrolls to the bottom of the page and waits for Netflix to load the next dynamic page of activity. This may be repeated multiple time until all of the activity is displayed. Calls getPageActivity() +Scrolls to the bottom of the page and waits for Netflix to load the next dynamic page of activity. This may be repeated multiple time until all of the activity is displayed. Calls get_page_activity() 
-== > getPageActivity() == +== > get_page_activity() == 
-Gets all viewing activity from the page. Displays a progress bar to the user. Calls common.outputActivity()\\+Gets all viewing activity from the page. Displays a progress bar to the user. Calls common.output_activity()\\
  
 ===== New Service Instructions ===== ===== New Service Instructions =====
Line 110: Line 108:
  - Retrieve viewing activity\\  - Retrieve viewing activity\\
  - Display progress bar (if possible)\\  - Display progress bar (if possible)\\
- - Call common.outputActivity() to output viewing activity into a .txt file\\+ - Call common.output_activity() to output viewing activity into a .txt file\\
 \\ \\
-common.outputActivity() accepts 2 parameters. The first is the name of the viewing service, the second is a list containing all of the viewing activity. Make user to '​import common'​ to use the function.\\+common.output_activity() accepts 2 parameters. The first is the name of the viewing service, the second is a list containing all of the viewing activity. Make user to '​import common'​ to use the function.\\
 \\ \\
 **3. Add you service into ActivityExtractor.py.**\\ **3. Add you service into ActivityExtractor.py.**\\
  • public/codein/activity_extractor_technical_docs.txt
  • Last modified: 2016/12/24 03:47
  • by manveer_b