#help_index "Misc/Blog" U8 *YouTubeGet(U8 *filename="~/Sup1/Sup1Blog/YouTube.DD.Z",U8 *needle) { I64 i=0,line=I64_MIN; CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR), *doc2=DocNew; U8 *title,*code,*res; while (DocFind(doc,line,needle)) { if (!(doc->cur_entry->y&1)) { title=doc->cur_entry->tag; DocLineNumGoTo(doc,doc->cur_entry->y+2); if (doc->cur_entry->type_u8==DOCT_TEXT) { code=doc->cur_entry->tag; DocPrint(doc2,"$$MU-UL,\"%s\",LE=0x%X$$\n",title,code); i++; } } line=doc->cur_entry->y+2; } switch (i) { case 0: res=NULL; break; case 1: res=StrNew(code); break; default: res=PopUpMenu(doc2); if (res==DOCM_CANCEL) res=NULL; else res=StrNew(res); } DocDel(doc); DocDel(doc2); return res; } U0 YouTubeAdd(U8 *filename="~/Sup1/Sup1Blog/YouTube.DD.Z", U8 *title,U8 *code) { CDoc *doc=DocRead(filename,DOCF_PLAIN_TEXT_TABS|DOCF_NO_CURSOR); if (!DocFind(doc,,title)) { DocBottom(doc); DocPrint(doc,"%s\n%s\n",title,code); DocTop(doc); DocWrite(doc); Sort(filename,,2); } DocDel(doc); } U8 *WebBookMarks(U8 *filename="~/Sup1/Sup1Blog/Bookmarks.html") { U8 *st; CDocEntry *doc_e; CDoc *doc=DocNew; CCmpCtrl *cc=CmpCtrlNew(MStrPrint("#include \"%s\"",filename)); while (Lex(cc)) if (cc->token==TK_STR && *cc->cur_str(U32 *)=='http') { DocPrint(doc,"$$MU-UL,\"%$$Q\",LE=0x%X$$\n",cc->cur_str,cc->cur_str); cc->cur_str=NULL; } CmpCtrlDel(cc); if ((st=PopUpMenu(doc))!=DOCM_CANCEL) st=StrNew(st); else st=NULL; doc_e=doc->head.next; while (doc_e!=doc) { if (doc_e->type_u8==DOCT_MENU_VAL) Free(doc_e->left_exp); doc_e=doc_e->next; } DocDel(doc); return st; } U0 TOSIns() { CWebBibleForm *url=CAlloc(sizeof(CWebBibleForm)); U8 *tag,*st,*st2; switch (PopUpPickLst("BiblePassage\0BibleVerse\0" "YouTube\0Imgur\0Wikipedia\0WebBookMark\0")) { case: if (DocForm(url(CWebBibleForm *))) { tag=url->special; st2=URLPercentSpaces(url->special); st=MStrPrint("http://www.biblegateway.com/passage/" "?search=%s&version=NIV",st2); Free(st2); if (*url->tag) tag=url->tag; "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st; Free(st); } break; case: if (DocForm(url(CWebBibleForm *))) { tag=url->special; st2=URLPercentSpaces(url->special); st=MStrPrint( "http://www.biblegateway.com/verse/en/%s",st2); Free(st2); if (*url->tag) tag=url->tag; "$$TX,\"%$$Q\",HTML=\"%$$Q\"$$",tag,st; Free(st); } break; case: if (DocForm(url(CYouTubeForm *))) { if (*url->special==CH_SPACE) st2=YouTubeGet(,url->tag); else st2=StrNew(url->special); if (st2 && *st2!=CH_SPACE) { if (url->min || url->sec) st=MStrPrint("%s&hl=enUS&start=%d",st2,url->min*60+url->sec); else st=StrNew(st2); if (*url->special!=CH_SPACE && *url->tag) YouTubeAdd(,url->tag,st); "$$HC,\"\"$$\n",st,st; Free(st); Free(st2); } } break; case: if (DocForm(url(CImgurForm *))) { "$$HC,\"