This file contains hidden or 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
| //Here’s a function that takes the GraphQL response and calculates the required totals for the company and affiliates: | |
| function processPipelineData(data) { | |
| if (!data || !data.CRM || !data.CRM.contact || !data.CRM.contact.associations) { | |
| return { companyPipeline: {}, affiliatePipeline: {} }; | |
| } | |
| const companyData = data.CRM.contact.associations.company?.items[0]; | |
| if (!companyData || !companyData.associations) { |
This file contains hidden or 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
| import requests | |
| import pandas as pd | |
| import time | |
| def fetch_players(gender): | |
| base_url = "https://drop-api.ea.com/rating/ea-sports-fc?locale=en&limit=100&gender=" | |
| offset = 0 | |
| all_players = [] | |
| while True: |
This file contains hidden or 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
| // This can be added as a boost in Arc Browsers for the community by adding this JS | |
| // Non Arc Users can use a chrome extension TamperMonkey | |
| // I have not ussed this, I only see it show up on stack overflow as solution | |
| // https://chromewebstore.google.com/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo | |
| // this could also be turned into a chrome extension, but my account is not verfied and I don't know how | |
| // to get it to work, so lol if you find this useful and you know how to get a extension account | |
| // figured out, let me know! | |
| (function() { | |
| // set your language code here |
This file contains hidden or 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
| I'm going to respond here and talk through some of the issues that make this difficult to do in HubSpot | |
| so, to get today's date we use `{{ local_dt }}` -- and we could just covert that to a timestamp using `{{ local_dt|unixtimestamp }}` and that would give me a unixtimestamp that I can use, but we really need "midnight" because we need the start of the today if we want to know if anything was updated today. | |
| In the code below I'm going to use the `|pprint` filter, which will show us what "types" these variables are as we convert them | |
| ``` | |
| <p>local_dt|pprint: {{ local_dt|pprint }}</p> | |
| {# output: local_dt|pprint: (PyishDate: 2024-12-19 12:24:03) #} | |
| <p>local_dt|format_date('M/d/yy'): {{ local_dt|format_date('M/d/yy')|pprint }}</p> | |
| {# output: local_dt|format_date('M/d/yy'): (String: 12/19/24) #} | |
| <p>local_dt|format_date('M/d/yy')|strtodate('M/d/yy'): {{ local_dt|format_date('M/d/yy')|strtodate('M/d/yy')|pprint }}</p> | |
| {# output: local_dt|format_date('M/d/yy')|strtodate('M/d/yy'): (PyishDate: 2024-12-19 00:00:00) #} |
This file contains hidden or 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
| {% set products = crm_objects("product", "limit=100") %} | |
| {% set midnight_today = local_dt|format_date('M/d/yy')|strtodate('M/d/yy')|unixtimestamp %} | |
| {% if products_data.total > 0 %} | |
| <div class="products__wrapper"> | |
| {% for result in products.results %} | |
| {% set product = crm_object("product", result.id, "name,price,hs_lastmodifieddate,createdate") %} | |
| {% set updated_date = product_details.hs_lastmodifieddate|strtodate('M/d/yy')|unixtimestamp %} | |
| {% set created_date = product_details.createdate|strtodate('M/d/yy')|unixtimestamp %} |
This file contains hidden or 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
| // this will export out a 8 years 6 months since date | |
| exports.main = async (event, callback) => { | |
| // you can change these to yr, yrs, mo, mos if you would like | |
| const terms = { | |
| year: 'year', | |
| yearPlural: 'years', | |
| month: 'month', | |
| monthPlural: 'months' | |
| } |
This file contains hidden or 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
| const hubspot = require('@hubspot/api-client'); | |
| exports.main = async (event, callback) => { | |
| // Created by Nathan De Long @ HubSpot, 1/14/2023 | |
| // This code is provided as-is, please test this code prior to using it in a live workflow in your environment. | |
| // modified by nick decker @ deckerdevs 1/14/2023 | |
| // modified to unnest code and change to our coding standards, cleaning it up etc | |
| // get the associated contacts for the parent company. note, trigger for this workflow is companies |
This file contains hidden or 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
| !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["lottie-player"]={})}(this,(function(exports){"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var REACT_ELEMENT_TYPE;function _jsx(t,e,r,i){REACT_ELEMENT_TYPE||(REACT_ELEMENT_TYPE="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var a=t&&t.defaultProps,s=arguments.length-3;if(e||0===s||(e={children:void 0}),1===s)e.children=i;else if(s>1){for(var n=new Array(s),o=0;o<s;o++)n[o]=arguments[o+3];e.children=n}if(e&&a)for(var h in a)void 0===e[h]&&(e[h]=a[h]);else e||(e=a||{});return{$$typeof:REACT_ELEMENT_TYPE,type:t,key:void 0===r?null:""+r,ref:null,props:e,_owner:null}}function _asyncIterator |
This file contains hidden or 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
| const hubspot = require('@hubspot/api-client'); | |
| exports.main = async (event, callback) => { | |
| const hubspotClient = new hubspot.Client({ | |
| accessToken: process.env.custom_code_private_app | |
| }); | |
| try { |
This file contains hidden or 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
| const hubspot = require('@hubspot/api-client'); | |
| // adding async to this main function here | |
| exports.main = async (event, callback) => { | |
| // Instantiate a new HubSpot private app (secret) | |
| const hubspotClient = new hubspot.Client({ | |
| accessToken: process.env.custom_code_private_app | |
| }); | |