lv7777 / githubcommiter Goto Github PK
View Code? Open in Web Editor NEWこのリポジトリ進捗ダメ
Home Page: https://github.com/lv7777/GithubCommiteratChrome
このリポジトリ進捗ダメ
Home Page: https://github.com/lv7777/GithubCommiteratChrome
使おうな
そろそろ完成したし綺麗にしていきましょうね
追加したいね。ブラウザアクションのhtmlの中に入れたい。
ボタンはアイコン付きで。
#5 と同じ
当たり前だが同じキーは上書きされてしまうので
"githubcommiter_"+設定名でurlと科パスワードとか入れたオブジェクトを作る予定
content_scripts.js:272 PUT https://api.github.com/repos/lv7777/translation/contents/www/google/co/jp/filenamefefe.html 409 (Conflict)
{
"message": "Sorry, a file exists where you’re trying to create a subdirectory. Choose a new path and try again.",
"documentation_url": "https://developer.github.com/v3/repos/contents/"
}
contentscript272はgetsha1(username, pass, repo, path, file).then(function ok(shaobj) {
のsend()
path +"/"+fileに変えた時
すでにtranslation/www/google/co/jpというファイルが存在している(translation/www/google/co/はディレクトリ)
なのでjpディレクトリを作れなかったんだと思われる。
ファイルの作成をする前にリポジトリを作成しないといけないらしくてやってみたんだけど
Problems parsing JSONとか言われる。
あとココだけなんです。
ファイルのupdateやcommit shaを取ってくるのは出来るんです。
誰かお願いします。
今タブ間での共有ができてない状態。多分これはchrome特有なので
#17 と一緒にしようか迷ったがまた違う感じなのでやめた。
function analyzeDomain(){
var url=window.location.href;
var retobj={};
retobj.domain=[];
retobj.filename="";
retobj.all=[];//urlを解析した破片ごとに
return retobj;
}
$ltime = $("#localtime");
$gtime = $("#githubtime");
$url = $("#url");
$repo = $("#repo");
$pass = $("#pass");
$username = $("#username");
let inputarray = [$ltime, $gtime, $url, $repo, $pass, $username];
//:TODO localstrageが使えるかの確認
//もしかしたらbackgroundscriptに投げることが必要かも
for (let i of inputarray) {
// localStorage.setItem(i.attr("id"), i.val())
let key = i.attr("id");
let val = i.val();
chrome.storage.local.set({ key: val }, function () {
// ここにset終わったあとの処理
console.log(key + " endsetting.js " + val);
});
chrome.storage.local.get("username", function (result) {
console.log(result.username);
// create2(encodesrc,result.username,result.pass,"lastremote.txt");
console.log("?ddsetting");
setはできてる
getが出来ない。
https://api.github.com/repos/lv7777/translation/contents/www/google/co/jp/ Failed to load resource: the server responded with a status of 404 (Not Found)
content_scripts.js:151 {
"message": "This repository is empty.",
"documentation_url": "https://developer.github.com/v3/repos/contents/#get-contents"
}
もしかしたらデータ構造の変更を防げるかもしれないって思ったけどあのデータ構造の変更は一回目で今回は2回目だから意味ないかもしれない。。。
先日の某失敗を受けてはてなブログを作る時もgithubcommiter適用したいんだけど確かアレの新しい記事ってurlじゃなくてタイトル名でファイル名を作らないと区別できないよね。
ということでファイル名を作る拡張関数を作りたい。
githubのissueのデータ消えたorz
regExpの返り血とbrowser_actionの最初のほう
解決策としては、XHRの中でif判定して次のメソッドを変える。
最初これやってたんだけどコードが汚い(あまりにも一つのメソッドが大きくなりすぎるな)と思って変えた。
悪策だったか。
もともとwebextension用に作っていたけどchromeextensionに変更した。
まあつまり移植する。
正規表現のとこがずれてる
もう解決済みだけど
デバッグはChromeでやること
あといちいちアイコンクリックしてデータ設定するのもめんどかった。
多分この場合はwebdriverが良いんだと思う。
npm版がある。VSとecripse orionとかいうやつには拡張機能としてあるらしい。
実装する
URLからドメインごとに配列に分ける正規表現
e.g.
https://github.com/lv7777/GithubCommiter/issues/new
arr[1]=github,arr[2]=com
状態。
input要素のclickはコピーしないでlabelとdivがクリックされた時のみコピーしたい。
ほんまつっかえ
オプションとしてつける
https://developer.github.com/v3/git/commits/#create-a-commit
こいつ使えば出来るっぽい。ただこれ面倒なんだよなあ。。。
俺前このAPI投げたもん。あまりにもめんどくて死んだ。
欲しい。どこに表示するかが問題。
settinghtmlにこれ以上入れると縦長になってつらい。。。
alertで表示するのが一番いいか。別にユーザーが押したいと思って押すんだし。誤操作とかも無いからね。
まともにする
う~んこの
httpstatuscode:422
"message": "Invalid request.\n\n"sha" wasn't supplied.",
だっておwwwwww
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.