Skip to content

Cav Scripts

Joshua Bell edited this page Nov 20, 2018 · 10 revisions

Google Apps Script Project URL

Site Tools

The site tools functions are built to grab certain information from from the 7th Cavalry Website after logging into the website. Currently the Google PropertiesService is used to fetch login information contained within the Script Properties (See table at end of page linked).

To call the Site Tools functions after importing the library use CavScripts.siteTools()

getCookie

This method gets the session cookie through the use of Google's urlFetchApp Service.

Input

Variable Name Type Description
user string 7Cav Forum username
pw string 7Cav Forum password

Output

Variable Name Type Description
N/A string session cookie

getPage

This method retrieves the raw HTML of a webpage that would require a login. Authentication for the forum is retrieved via the getCookie method documented above.

Variable Name Type Description
URL string URL of a 7cav.us page

this getPage will throw an error if the URL entered is not a proper 7cav.us URL.

getThreads

UNDER CONSTRUCTION

This method retrieves a list of threads present on a forum board.

Input

Variable Name Type Description
URL string 7Cav forum url
pageOptions integer How the method will handle multiple pages [Default: 0] (see below for parameters) NOT IN USE... YET

pageOptions Parameters: (Will only use parameter 0 till feature is fixed)

  • 0 - Only first page
  • 1 - All pages
  • 2 - Only last page

Output

Primary output will be an array with each index being a object literal containing the following information about each post:

Variable Name Type Description
title string Thread title
id integer Thread id

getThreads will throw an error if the URL is not a proper 7cav.us forum URL (7cav.us/forums/).

parseThread

This method grabs specific information from a thread

Clone this wiki locally