207월/20

애플 앱스토어 번들아이디(bundle id) 찾기

앱 광고를 진행하는 도중 apple군 앱의 번들아이디가 필요한 경우가 있었다. apple쪽.. 아직 아이폰도 써보지 않아서 뭔가 생소하다. 구글 스토어의 경우 url에 id가 명시되어 있어서 편리하다. https://play.google.com/store/apps/details?id=com.corenet.AppManner 어쨋든 애플의 경우 아직 방법을 모르는건지 bundle id 찾기가 까다롭다. 앱스토어에 접속한다. https://apps.apple.com/kr/app/l-point-%EC%97%98%ED%8F%AC%EC%9D%B8%ED%8A%B8/id473250588 url 마지막 부분 id고유번호를 저장해둔다. 아래 주소로 접근한다. https://itunes.apple.com/lookup?id=고유번호 txt 파일을 다운로드 받고 bundle id를 찾는다. “bundleId”:”com.lottecard.LotteMembers”  

285월/20

php7 마이그레이션 대체

mysql_query(query) => mysqli_query(connection, query) mysql_fetch_assoc => mysqli_fetch_assoc mysql_fetch_array => mysqli_fetch_array mysql_num_rows => mysqli_num_rows mysql_affected_rows() => mysqli_affected_rows(connection) mysql_data_seek => mysqli_data_seek   ereg(pattern, source) => preg_match(/pattern/, source)  

144월/20

JCenter(Bintray) 배포 방법

Android Module을 개발 완료하였다면 배포방안이 필요하다. Bintray에 업로드를 하고 JCenter를 연결하여 해결할 수 있다. 그렇게 되면 아래와같이 dependencies 항목에 추가할 수 있게 된다. dependencies { implementation ‘kr.co.paep:paep-sdk:1.0.1’ } https://bintray.com/ 에 회원가입을 한다. open source로 가입하도록 한다. repository를 하나 생성해준다. 이름을 명시해주고, Type을 Maven 으로 선택하였다. 우측상단의 프로필을 선택하여 Edit Profile에 접속하면 API Key를 얻을 수 있다. 기록해두자. 안드로이드 스튜디오에서 gradle 작업을 진행한다. project build.gradle buildscript { repositories { jcenter() } dependencies { classpath ‘com.jfrog.bintray.gradle:gradle-bintray-plugin:1.+’ classpath ‘com.github.dcendents:android-maven-gradle-plugin:2.1’ } } module build.gradle ext { bintrayRepo = ‘paep’ bintrayName = ‘paep-sdk’ publishedGroupId = ‘kr.co.paep’ libraryName = ‘paep-sdk’ artifact = ‘paep-sdk’ libraryDescription = ‘PAEP adx library’ siteUrl = ‘https://github.com/phaserep/paep-android-sdk’ gitUrl = ‘https://github.com/phaserep/paep-android-sdk.git’ libraryVersion = ‘1.0.1’ developerId = ‘jakeyu’ // Maven plugin uses this. I don’t know if it needs to be anything special. developerName = ‘Jake Yu’ developerEmail = ‘jake@phaserep.com’ licenseName = ‘The MIT License (MIT)’ licenseUrl = ‘https://opensource.org/licenses/MIT’ allLicenses = [“MIT”] } android { } dependencies { } apply plugin: ‘com.github.dcendents.android-maven’ group = publishedGroupId // Maven Group ID for the artifact install { repositories.mavenInstaller { // This generates POM.xml with proper parameters pom { project { packaging ‘aar’ groupId publishedGroupId artifactId artifact // Add your description here name libraryName description libraryDescription url siteUrl더보기…

024월/20

httpd 프로세스 누적 처리

httpd 프로세스가 누적되는 경우가 종종 있다. 특히 워드프레스.. 음 안쓰기도 뭐하고.. 무거운 워드프레스를 다 해집기 보다는.. 그냥 재시작 처리를 해두는게 나을지도 #!/bin/sh while ( true ) ; do if [ “`ps aux | grep httpd | wc -l`” -ge “50” ] ; then systemctl restart httpd date >> /home/engineer/shell/apache_auto_restart.log fi sleep 10 done 프로세스 수량 50은.. 봐가면서 변경

1012월/19

bootstrap datepicker language, format 설정

언어 설정 가이드 : https://bootstrap-datepicker.readthedocs.io/en/stable/i18n.html 한국어js : https://github.com/uxsolutions/bootstrap-datepicker/blob/master/dist/locales/bootstrap-datepicker.ko.min.js <script src=”/assets/js/bootstrap-datepicker.ko.min.js” charset=”UTF-8″></script> <script src=”/assets/js/bootstrap-datepicker.js” type=”text/javascript”></script> $(‘#date1’).datepicker({ format: ‘yyyy-mm-dd’, language: “ko” }

1311월/19

php 로그인, 크롤링 by Snoopy

간혹 업체의 report api가 구비되지 않아서 크롤링을 한다거나, 주기적인 업데이트를 위해 크롤링이 필요한 경우가 있다. 그와중에 로그인 후 크롤링을 할 경우까지 종종 등장한다. 이때 오래되었으나 snoopy 라이브러리를 이용하면 좋다. Snoopy download https://sourceforge.net/projects/snoopy/ 바로 import하여 사용한다. <?php require_once(‘lib/Snoopy.class.php’); $snoopy = new Snoopy; $snoopy->agent = “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)”; //login $loginUri = ‘http://www.bluebee.co.kr/loginTest.php’; $snoopy->httpmethod = “POST”; $auth[‘id’] = ‘bluebee’; $auth[‘password’] = ‘1234’; $snoopy->submit($loginUri, $auth); $snoopy->setcookies(); //로그인에 쿠키를 사용하는 경우가 있으니 쿠키정보를 저장 $loginResult = json_decode($snoopy->results); $report_data = array(); if($loginResult->{‘ret’} != “ok”) { echo ‘Login 실패!’; exit; } else { //리포트 데이터 크롤링 $reportUri = ‘http://www.bluebee.co.kr/reportTest.php’; $snoopy->httpmethod = “POST”; $report[‘sdate’] = ‘2019-11-01’; $report[‘edate’] = ‘2019-11-13’; $snoopy->submit($reportUri, $report); preg_match(‘/<tr class=”reportR”>(.*?)<\/tr>/is’, $snoopy->results, $result_report_tr); if(sizeof($result_report_tr) > 1) { preg_match_all(‘/<td[^>]*>(.*?)<\/td>/is’, $result_report_tr[1], $result_report_td); /*데이터 정리*/ } } ?> 로그인이 필요한 경우 간편하게~ 대충 이런 형태로 간단하게 뽑아낼 수 있겠다.   오류 발생 대처 방법 PHP Deprecated: The each() function is deprecated. php버전에 따라 오류발생 가능 Snoopy.class.php 의 each 관련 사항을 모두 foreach로 수정 예) while (list($key, $val) = each($links[2])) { => foreach($links[2] as $key => $val) { 그외 딱히 이슈될건 없다.