GithubHelp home page GithubHelp logo

rdpcrawlersdk's Introduction

RDPCrawlerSDK

a crawler sdk of rong360

支持的iOS最低版本7.1, Xcode 8.0

需要先申请appid, 配置好相应的证书和回调url

接入步骤:

1.在Podfile文件里添加 pod 'RDPCrawlerSDK', 然后pod update(需更新下本地pod仓库,避免本地仓库不包含sdk的信息)

2.在工程中的info.plist中的添加LSApplicationQueriesSchemes数组,在数组里面添加一个支持的scheme:alipayqr

3.初始化sdk, 调用接口传入appid和对应的p12格式的私钥

NSString *keyPath = [[NSBundle mainBundle] pathForResource:@"private" ofType:@"p12"];

NSData *keyData = [NSData dataWithContentsOfFile:keyPath];

如私钥文件没有设置密码调用以下方法:

[RDPCrawlerManager configAppId:@"申请的appid" delegate:self privateKey:keyData];

如私钥文件设置了密码调用另一个方法:

[RDPCrawlerManager configAppId:@"申请的appid" delegate:self privateKey:keyData password:@"私钥密码"];

4.调用所需类型的抓取服务

支付宝抓取:

[RDPCrawlerManager startCrawlerByType:kRDPCrawlerTypeAlipay identifier:@"自定义的任务id"];

淘宝抓取:

[RDPCrawlerManager startCrawlerByType:kRDPCrawlerTypeTaobao identifier:@"自定义的任务id"];

 ps:

   如需使用测试环境联调,需调用[RDPCrawlerManager setIsDebug:YES]

   pem转p12的步骤,需在终端输入如下命令:

如pem文件为private.pem

   (1) 生成一个csr文件

  openssl req -new -key private.pem -out rsacert.csr

    这时候要求输入以下一些证书配置信息

  Country Name (2 letter code) [AU]:CN

  State or Province Name (full name) [Some-State]:beijing

  Locality Name (eg, city) []:beijing

  Organization Name (eg, company) [Internet Widgits Pty Ltd]:Rong360

  Organizational Unit Name (eg, section) []:com

  Common Name (e.g. server FQDN or YOUR name) []:R360

  Email Address []:[email protected]

  Please enter the following 'extra' attributes

  to be sent with your certificate request

  A challenge password []:

  An optional company name []:

(2)生成证书并且签名,有效期10年

  openssl x509 -req -days 3650 -in rsacert.csr -signkey private.pem -out rsacert.crt

  (3)生成P12文件

  openssl pkcs12 -export -out private.p12 -inkey private.pem -in rsacert.crt

rdpcrawlersdk's People

Contributors

whj5484138 avatar

Watchers

James Cloos avatar 魏东方 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.