This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var SimpleAdding = function(num){ | |
var total = 0 | |
for (var i = 1; i<= num; i++){ | |
total = total + i; | |
console.log(total); | |
} | |
}; | |
SimpleAdding(6); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title> Jessica Weinberg</title> | |
<link rel="stylesheet" href="css/normalize.css"> | |
<link href='http://fonts.googleapis.com/css?family=Quintessential' rel='stylesheet' type='text/css'> | |
<link rel="stylesheet" href="css/main.css"> | |
<style> | |
nav a { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (api GraphV2) GetContentInBatches(path string, since, until int64, fields ...string) ([]BatchResponse, error) { | |
url := fmt.Sprintf("%v/%v?fields=id&since=%v&until=%v&limit=%v&access_token=%v", HostV2, path, since, until, BatchLimit, api.AccessToken) | |
ids := []string{} | |
for { | |
resp, err := GetFacebookGraphRequest(url) | |
if err != nil { | |
return nil, err | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type FacebookGraphResponse struct { | |
Data []GraphResponseData `json:"data"` | |
Error Error `json:"error_msg"` | |
ErrorMessage string `json:"error_msg"` // If a serious problem occurs facebook will return a different format of error message | |
ErrorCode int `json:"error_code"` | |
Paging struct { | |
Cursors struct { | |
Before string `json:"before"` | |
After string `json:"after"` | |
} `json:"cursors"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (api GraphV2) PostGraphRequests(urls []string) ([]BatchResponse, error) { | |
batchCh := make(chan []BatchResponse) | |
errs := make(chan error) | |
responses := []BatchResponse{} | |
var wg sync.WaitGroup | |
for _, url := range urls { | |
wg.Add(1) | |
go func(url string) { | |
defer wg.Done() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/csv" | |
"fmt" | |
"io" | |
"os" | |
"strconv" | |
"time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/csv" | |
"fmt" | |
"io" | |
"os" | |
"strconv" | |
"time" |