yarnlang

0.1.0-176 • Public • Published

yarn

the more you know - the less you need

samples

canon (not working)
/// set the name 'query' to the value 'yarnlang'
set [query] [yarnlang],

/// search twitter for the value of 'query', store the results in 'twitter results'
search twitter [twitter results] (query),

/// search facebook for the value of 'query', store the results in 'facebook results'
search facebook [facebook results] (query),

/// search tumblr for the value of 'query', store the results in 'tumblr results'
search tumblr [tumblr results] (query),

/// combine all three results, store the combined in 'combined results'
cat [combined results] [twitter results] [facebook results] [tumblr results],

/// sort the combined results by their respectively named creation dates
sort [combined results] (a.tweeted_at) (a.facebooked_at) (a.tumbled_at) [>] (b.tweeted_at) (b.facebooked_at) (b.tumbled_at),

/// delete any results that don't have an image
filter [combined results] [!] (a.tweet.image) (a.facebooked.image) (a.tumbled.image),

/// loop though all remaining results
for [result] [combined results],

	/// loop through each tag in result
	for [tag] [result.tags],

		/// search google for tag
		get [tag.google search] [https://www.google.com/search?q=] + (tag),

		/// match the page result count
		match (tag.about results matches) [About .+ results] (tag.google search.body),

		/// read the page count
		float (tag.page count) (tag.about results matches.0),

	end for,

	/// average the tag's page counts
	average [result.average tag page count] (result.tags.*.page count),

end for,

/// sort remaining results by their average tag page count
sort [combined results] (a.average tag page count) [>] (b.average tag page count)
google analytics (working)
/// get accounts for login
google analytics accounts [accounts], 

/// get web properties from first account
google analytics web properties [web properties] (accounts.items.0.id), 

/// get profiles from account + web property combo
google analytics profiles [profiles] (accounts.items.0.id) (web properties.items.0.id),

/// generate a monthly report of visits with single day granularity
google analytics reporting [report] (profiles.items.0.id) [Sept 23 2013 11:31:07 GMT-0400 (EDT)] [Oct 23 2013 11:31:07 GMT-0400 (EDT)] [ga:visits] [ga:date]
google analytics output
{
 "accounts.kind": "analytics#accounts",
 "accounts.username": "adrnsly@dashbook.co",
 "accounts.totalResults": 1,
 "accounts.startIndex": 1,
 "accounts.itemsPerPage": 1000,
 "accounts.items.0.id": "38829403",
 "accounts.items.0.kind": "analytics#account",
 "accounts.items.0.selfLink": "https://www.googleapis.com/analytics/v3/management/accounts/38829403",
 "accounts.items.0.name": "Dashbook",
 "accounts.items.0.permissions.effective.0": "COLLABORATE",
 "accounts.items.0.permissions.effective.1": "EDIT",
 "accounts.items.0.permissions.effective.2": "MANAGE_USERS",
 "accounts.items.0.permissions.effective.3": "READ_AND_ANALYZE",
 "accounts.items.0.created": "2013-02-26T21:27:58.713Z",
 "accounts.items.0.updated": "2013-05-14T01:24:14.503Z",
 "accounts.items.0.childLink.type": "analytics#webproperties",
 "accounts.items.0.childLink.href": "https://www.googleapis.com/analytics/v3/management/accounts/38829403/webproperties",
 "web properties.kind": "analytics#webproperties",
 "web properties.username": "adrnsly@dashbook.co",
 "web properties.totalResults": 1,
 "web properties.startIndex": 1,
 "web properties.itemsPerPage": 1000,
 "web properties.items.0.id": "UA-38829403-1",
 "web properties.items.0.kind": "analytics#webproperty",
 "web properties.items.0.selfLink": "https://www.googleapis.com/analytics/v3/management/accounts/38829403/webproperties/UA-38829403-1",
 "web properties.items.0.accountId": "38829403",
 "web properties.items.0.internalWebPropertyId": "67547626",
 "web properties.items.0.name": "Dashbook",
 "web properties.items.0.websiteUrl": "http://dashbookapp.com",
 "web properties.items.0.level": "STANDARD",
 "web properties.items.0.profileCount": 1,
 "web properties.items.0.industryVertical": "COMPUTERS_AND_ELECTRONICS",
 "web properties.items.0.defaultProfileId": "69466967",
 "web properties.items.0.permissions.effective.0": "COLLABORATE",
 "web properties.items.0.permissions.effective.1": "EDIT",
 "web properties.items.0.permissions.effective.2": "MANAGE_USERS",
 "web properties.items.0.permissions.effective.3": "READ_AND_ANALYZE",
 "web properties.items.0.created": "2013-02-26T21:27:58.713Z",
 "web properties.items.0.updated": "2013-08-21T15:44:29.534Z",
 "web properties.items.0.parentLink.type": "analytics#account",
 "web properties.items.0.parentLink.href": "https://www.googleapis.com/analytics/v3/management/accounts/38829403",
 "web properties.items.0.childLink.type": "analytics#profiles",
 "web properties.items.0.childLink.href": "https://www.googleapis.com/analytics/v3/management/accounts/38829403/webproperties/UA-38829403-1/profiles",
 "profiles.kind": "analytics#profiles",
 "profiles.username": "adrnsly@dashbook.co",
 "profiles.totalResults": 1,
 "profiles.startIndex": 1,
 "profiles.itemsPerPage": 1000,
 "profiles.items.0.id": "69466967",
 "profiles.items.0.kind": "analytics#profile",
 "profiles.items.0.selfLink": "https://www.googleapis.com/analytics/v3/management/accounts/38829403/webproperties/UA-38829403-1/profiles/69466967",
 "profiles.items.0.accountId": "38829403",
 "profiles.items.0.webPropertyId": "UA-38829403-1",
 "profiles.items.0.internalWebPropertyId": "67547626",
 "profiles.items.0.name": "Dashbook",
 "profiles.items.0.currency": "USD",
 "profiles.items.0.timezone": "America/Montreal",
 "profiles.items.0.websiteUrl": "http://dashbookapp.com",
 "profiles.items.0.type": "WEB",
 "profiles.items.0.permissions.effective.0": "COLLABORATE",
 "profiles.items.0.permissions.effective.1": "EDIT",
 "profiles.items.0.permissions.effective.2": "MANAGE_USERS",
 "profiles.items.0.permissions.effective.3": "READ_AND_ANALYZE",
 "profiles.items.0.created": "2013-02-26T21:27:58.713Z",
 "profiles.items.0.updated": "2013-09-27T16:59:32.722Z",
 "profiles.items.0.eCommerceTracking": false,
 "profiles.items.0.parentLink.type": "analytics#webproperty",
 "profiles.items.0.parentLink.href": "https://www.googleapis.com/analytics/v3/management/accounts/38829403/webproperties/UA-38829403-1",
 "profiles.items.0.childLink.type": "analytics#goals",
 "profiles.items.0.childLink.href": "https://www.googleapis.com/analytics/v3/management/accounts/38829403/webproperties/UA-38829403-1/profiles/69466967/goals",
 "report.kind": "analytics#gaData",
 "report.id": "https://www.googleapis.com/analytics/v3/data/ga?ids=ga:69466967&dimensions=ga:date&metrics=ga:visits&start-date=2013-09-23&end-date=2013-10-23",
 "report.query.start-date": "2013-09-23",
 "report.query.end-date": "2013-10-23",
 "report.query.ids": "ga:69466967",
 "report.query.dimensions": "ga:date",
 "report.query.metrics.0": "ga:visits",
 "report.query.start-index": 1,
 "report.query.max-results": 1000,
 "report.itemsPerPage": 1000,
 "report.totalResults": 31,
 "report.selfLink": "https://www.googleapis.com/analytics/v3/data/ga?ids=ga:69466967&dimensions=ga:date&metrics=ga:visits&start-date=2013-09-23&end-date=2013-10-23",
 "report.profileInfo.profileId": "69466967",
 "report.profileInfo.accountId": "38829403",
 "report.profileInfo.webPropertyId": "UA-38829403-1",
 "report.profileInfo.internalWebPropertyId": "67547626",
 "report.profileInfo.profileName": "Dashbook",
 "report.profileInfo.tableId": "ga:69466967",
 "report.containsSampledData": false,
 "report.columnHeaders.0.name": "ga:date",
 "report.columnHeaders.0.columnType": "DIMENSION",
 "report.columnHeaders.0.dataType": "STRING",
 "report.columnHeaders.1.name": "ga:visits",
 "report.columnHeaders.1.columnType": "METRIC",
 "report.columnHeaders.1.dataType": "INTEGER",
 "report.totalsForAllResults.ga:visits": "634",
 "report.rows.0.0": "20130923",
 "report.rows.0.1": "15",
 "report.rows.1.0": "20130924",
 "report.rows.1.1": "6",
 "report.rows.2.0": "20130925",
 "report.rows.2.1": "38",
 "report.rows.3.0": "20130926",
 "report.rows.3.1": "43",
 "report.rows.4.0": "20130927",
 "report.rows.4.1": "18",
 "report.rows.5.0": "20130928",
 "report.rows.5.1": "2",
 "report.rows.6.0": "20130929",
 "report.rows.6.1": "3",
 "report.rows.7.0": "20130930",
 "report.rows.7.1": "14",
 "report.rows.8.0": "20131001",
 "report.rows.8.1": "14",
 "report.rows.9.0": "20131002",
 "report.rows.9.1": "43",
 "report.rows.10.0": "20131003",
 "report.rows.10.1": "42",
 "report.rows.11.0": "20131004",
 "report.rows.11.1": "24",
 "report.rows.12.0": "20131005",
 "report.rows.12.1": "11",
 "report.rows.13.0": "20131006",
 "report.rows.13.1": "13",
 "report.rows.14.0": "20131007",
 "report.rows.14.1": "46",
 "report.rows.15.0": "20131008",
 "report.rows.15.1": "36",
 "report.rows.16.0": "20131009",
 "report.rows.16.1": "24",
 "report.rows.17.0": "20131010",
 "report.rows.17.1": "19",
 "report.rows.18.0": "20131011",
 "report.rows.18.1": "12",
 "report.rows.19.0": "20131012",
 "report.rows.19.1": "8",
 "report.rows.20.0": "20131013",
 "report.rows.20.1": "9",
 "report.rows.21.0": "20131014",
 "report.rows.21.1": "18",
 "report.rows.22.0": "20131015",
 "report.rows.22.1": "93",
 "report.rows.23.0": "20131016",
 "report.rows.23.1": "21",
 "report.rows.24.0": "20131017",
 "report.rows.24.1": "18",
 "report.rows.25.0": "20131018",
 "report.rows.25.1": "11",
 "report.rows.26.0": "20131019",
 "report.rows.26.1": "4",
 "report.rows.27.0": "20131020",
 "report.rows.27.1": "2",
 "report.rows.28.0": "20131021",
 "report.rows.28.1": "18",
 "report.rows.29.0": "20131022",
 "report.rows.29.1": "7",
 "report.rows.30.0": "20131023",
 "report.rows.30.1": "2"
}

Readme

Keywords

none

Package Sidebar

Install

npm i yarnlang

Weekly Downloads

1

Version

0.1.0-176

License

BSD

Last publish

Collaborators

  • abseeley