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
# -*- coding: utf-8 -*- | |
from flask import Flask, request, render_template | |
import urllib.request | |
import json | |
BASE_URL = "http://test.example.com:8080" | |
#値の検証とuidの取得 | |
def validate(token): | |
req = urllib.request.Request( |
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
# -*- coding: utf-8 -*- | |
from Crypto.Hash import SHA256 | |
from Crypto.PublicKey import RSA | |
from Crypto.Signature import PKCS1_v1_5 | |
from Crypto.Util.number import bytes_to_long | |
from flask import Flask, request, session, render_template | |
from urllib.error import HTTPError | |
import urllib.request | |
import base64 | |
import json |
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
import serial | |
import urllib.request | |
import json | |
CLIENT_ID = "input your client_id" | |
CLIENT_SECRET = "input your client_secret" | |
#chatterにポストする | |
def postFeedItem(val): | |
try: |
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
#include <SPI.h> | |
#include <Ethernet.h> | |
const int BUTTON = 7; | |
int val = 0; | |
int old_val = 0; | |
//ethernetシールドのmacアドレス | |
byte mac[] = {0x**, 0x**, 0x**, 0x0F, 0x8B, 0x8A}; | |
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
/** | |
* クエリ発行してスプレッドシートに書き込み | |
*/ | |
function query(q) { | |
checkAuthorization(); | |
//クエリ発行 | |
var prop = PropertiesService.getUserProperties(); | |
var sessionInfo = JSON.parse(prop.getProperty("session_info")); | |
var res = UrlFetchApp.fetch(sessionInfo.instance_url + "/services/data/v30.0/query/?q=" + q, { |
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
/** | |
* 更新クエリ | |
*/ | |
function updateAccount() { | |
checkAuthorization(); | |
var prop = PropertiesService.getUserProperties(); | |
var sessionInfo = JSON.parse(prop.getProperty("session_info")) | |
//選択したセルがSalesforceのAccountIDであることを想定 | |
var accountId = SpreadsheetApp.getActiveRange().getValue(); | |
var res = UrlFetchApp.fetch( |
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
/** | |
* カスタムオブジェクトGAS__cを作成する。 | |
*/ | |
function createObject() { | |
//package.xml作成 | |
var package = Utilities.newBlob("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\ | |
<Package xmlns=\"http://soap.sforce.com/2006/04/metadata\">\ | |
<types><name>CustomObject</name><members>GAS__c</members>\ | |
</types><version>30.0</version>\ | |
</Package>").setName("hogehoge/package.xml"); |
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
Private Sub login() | |
Dim sfc As SfdcSoapXml | |
Set sfc = New SfdcSoapXml | |
Dim body As String | |
body = sfc.LOGIN | |
body = Replace(body, "{{username}}", "*******") | |
body = Replace(body, "{{password}}", "******") | |
Dim response As String | |
response = callSoap("https://login.salesforce.com/services/Soap/u/30.0", body) |
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
Dim objXmlHttp As Object | |
Set objXmlHttp = createObject("MSXML2.XMLHTTP") | |
objXmlHttp.Open "GET", "https://***.salesforce.com/services/data/v30.0/query/?q=SELECT id FROM Account") | |
Call objXmlHttp.setRequestHeader("Content-Type", "application/json") | |
Call objXmlHttp.setRequestHeader("Authorization", "Bearer " + sessionId) | |
Call objXmlHttp.setRequestHeader("Accept", "application/xml") | |
objXmlHttp.send | |
CallRestApi = objXmlHttp.responseText |
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
Dim ws As Worksheet | |
Set ws = Worksheets("CreateObject") | |
Dim createObjectBody As String | |
createObjectBody = sfc.CREATE_OBJECT | |
createObjectBody = Replace(createObjectBody, "{{sessionId}}", sessionId) | |
createObjectBody = Replace(createObjectBody, "{{fullName}}", ws.Cells(3, 2)) | |
createObjectBody = Replace(createObjectBody, "{{deploymentStatus}}", "Deployed") | |
createObjectBody = Replace(createObjectBody, "{{description}}", ws.Cells(6, 2)) | |
createObjectBody = Replace(createObjectBody, "{{label}}", ws.Cells(1, 2)) | |
createObjectBody = Replace(createObjectBody, "{{nameField.label}}", ws.Cells(4, 2)) |
OlderNewer