Un Bot de Telegram para que el usuario interaccione con tu blog
Netlify is a cloud computing company that offers hosting and serverless backend services for static websites (Wikipedia)
You can link your git (github/gitlab/…) repo with your Netlify account and deploy your static site into it in a similar way of Github/Gitlab Pages but with the add you can use some out of the box backend features as:
-
forms: if your static content has a form you can receive an email when some user fill it
-
aws function: you can define AWS lambda functions and execute it when the user relaizes some action with your content
-
Basic auth and OAuth providers
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
package scrapping.google | |
import geb.Page | |
import geb.spock.GebSpec | |
import org.openqa.selenium.By | |
import org.openqa.selenium.OutputType | |
import org.openqa.selenium.Point | |
import org.openqa.selenium.TakesScreenshot | |
import org.openqa.selenium.WebElement | |
import spock.lang.Specification |
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
/* | |
Si tienes una lista de registros en una sóla columna (por ejemplo una lista de IDs) | |
y los necesitas en filas puedes usar la función `=TRANSPOSE` | |
pero si son miles de registros la funcion dará un error. | |
Con esta función transpones la columna en N filas de SIZE elementos | |
*/ | |
function trasponer_agrupar(input, size) { | |
if( !input.map ) | |
return []; | |
var array = []; |
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
/* | |
In a Google Sheet select Tools->Script Editor and copy&paste this code and save the file | |
You can use this function in a cell as: | |
=pow_matrix(A5:C7,3) | |
*/ | |
function pow_matrix(a, n) { | |
if( !a.map ) |
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
@Grab(group='org.apache.pdfbox', module='pdfbox', version='2.0.8') | |
import org.apache.pdfbox.pdmodel.PDDocument | |
import org.apache.pdfbox.text.* | |
import java.awt.Rectangle | |
margenright = 10 | |
def model=[:] | |
txtboe = new PDFTextStripper().getText( PDDocument.load( new URL("https://www.boe.es/boe/dias/2015/09/12/pdfs/BOE-A-2015-9803.pdf").bytes ) ) | |
txtboe = txtboe.replaceAll('\n',' ') |
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 onOpen(e) { | |
var ui = SpreadsheetApp.getUi(); | |
ui.createAddonMenu().addItem('Raffle', 'raffleUI').addToUi(); | |
} | |
function getRemains(){ | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getActiveSheet(); | |
var ret = []; | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<base target="_top"> | |
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css"> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
</head> | |
<body> | |
<h1><?!= LanguageApp.translate('Bienvenido','',Session.getActiveUserLocale()) ?></h1> | |
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
package mn.telegram | |
import io.micronaut.http.MediaType; | |
import io.micronaut.http.annotation.Controller; | |
import io.micronaut.http.annotation.Get; | |
import io.micronaut.http.annotation.Produces; | |
import javax.inject.Inject | |
import com.puravida.mn.telegram.* | |
@Controller("/hello") |
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 telegram(){ | |
var bot = 'XXXXXX:YYYYYYYYYYYYY' | |
var chatId = 'CHANNEL_ID' | |
var url = 'https://api.telegram.org/bot'+bot | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getActiveSheet(); | |
var rangeData = sheet.getDataRange(); | |
var lastColumn = rangeData.getLastColumn(); |