Skip to content

Instantly share code, notes, and snippets.

View tiagomatos's full-sized avatar

Tiago Matos tiagomatos

View GitHub Profile
@jlgabriel
jlgabriel / get_productos_jumpseller.py
Last active January 6, 2024 23:10
Script en Python que lee JSON de productos de tienda Jumpseller mediante el API y lo exporta como tabla en formatos Excel y CSV
import requests
import math
import pandas as pd
import flatten_json
# instalar flatten_json con: pip install flatten_json
# Referencia: https://github.com/amirziai/flatten
# parámetros
url_api_productos_contar = "https://api.jumpseller.com/v1/products/count.json"
// Step 1: Create a virtual Product Called "Envio a Cobranza" with two Variants: Portugal/Spain
// Step 2: Get the Product and variants IDs
// Step 3: replace the following variables with the Product ID (in the product settings URL), Variant Ids (see tip below) and Manual Payment ID (In the payment method URL in the admin panel)
var productId = "2388937"
var portugalId = "1883423"
var spainId = "1883423"
var paymentId = "136033"
/* TIP: To get the variant ID of the countries I added this code to the product page and checked the console
class Date
def to_words
if self == Date.today
"Today"
elsif self <= Date.today - 1
if self == Date.today - 1
"Yesterday"
elsif ((Date.today - 7)..(Date.today - 1)).include?(self)
"Last #{self.strftime("%A")}"
elsif ((Date.today - 14)..(Date.today - 8)).include?(self)