From 9805fd21fdc8f740d9c93aac08c34df421875bd9 Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Sun, 10 Aug 2014 20:49:56 -0700 Subject: [PATCH] Add old twitter app. --- main/app/a-twit/core.hook | 114 +++++++++++++++++++++++++++++++++++++ main/app/a-twit/main.css | 117 ++++++++++++++++++++++++++++++++++++++ main/app/a-twit/main.js | 64 +++++++++++++++++++++ main/app/a-twit/twit.json | 1 + main/app/twit/core.hook | 98 +++++++++++++++++++++---------- main/app/twit/main.js | 35 ++++++++---- 6 files changed, 389 insertions(+), 40 deletions(-) create mode 100644 main/app/a-twit/core.hook create mode 100644 main/app/a-twit/main.css create mode 100644 main/app/a-twit/main.js create mode 100644 main/app/a-twit/twit.json diff --git a/main/app/a-twit/core.hook b/main/app/a-twit/core.hook new file mode 100644 index 000000000..895ad13f0 --- /dev/null +++ b/main/app/a-twit/core.hook @@ -0,0 +1,114 @@ +/+ twitter +!: +=> |% + ++ rev 0 + ++ axle ,[@ @] + ++ gilt :: State data + $% [%json p=json] :: JSON format + [%html p=@t] + [%hymn p=manx] :: HTML format + == + ++ gift :: Message data + $% [%rust gilt] :: Refresh webapp + [%rush gilt] :: Update webapp + [%mean (unit (pair term (list tank)))] :: Error, maybe w/ msg + [%nice ~] :: Response message + == + ++ move ,[p=bone q=(mold note gift)] :: Arvo command + ++ sign + $% $: %e + $% [%thou p=httr] + == == == + ++ note :: Arvo message + $% $: %e + $% [%them p=(unit hiss)] + == == == + ++ app-key :: specific keys + :- :- 'hDDOTPfGHGlsOUbhpy6qc6XbW' + 'olCkea6wm3XG4pnVCHuPIozUF2ggH1sHjnBtuT4Ai6rCOeQGzO' + :- '2485712317-R77Lpdu5rAJadRVxTXPpnxvcwS0IfNG7QEzLPty' + 'a41d83XId0P7QQbodkPYv3zxoEL0Cq9EsN2eXZBZAwAWA' +-- +|_ [hid=hide vat=axle] +:: +++ root :: App root location + /(scot %p our.hid)/main/(scot %da lat.hid)/app/[app.hid] +:: +++ incl :: Include scripts + |= wal=wall + %+ turn wal + |= tape ;script(type "text/javascript", src +<); +:: +++ peer :: Accept subscribes + |= [ost=bone you=ship pax=path] + ^- [(list move) _+>] + ?~ pax + :: [[ost %give %rust %hymn page]~ +>.$] + [[ost %pass /curl1 %e [%them (some timl)]]~ +>.$] + [~ +>.$] +:: +++ poke-json + |= [ost=bone his=ship jon=json] + ^- [(list move) _+>] + :: this is where you take the jon and post it to twitter. + ~& [%got-json jon] + [[ost %pass /curl2 %e [%them (some (posl jon))]]~ +>.$] + ::[[ost %give %nice ~]~ +>.$] +:: +++ page + |= a=@t + ^- manx + ;html + ;head + ;style:"{(trip ;;(,@ .^(%cx (welp root /main/css))))}" + ;* %- incl :~ + "//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js" + == + ;title: Urbit - Twitter Test + == + ;body + ;div#c + ;div#d + ;div#twet + ;div.author: @urbit_test + ;div.date; + ;textarea#tweetr(placeholder "What would you like to tweet?"); + ;input#submit(type "button", value "Send"); + ;input#length(type "button", value "0/140"); + == + ;div#time; + == + == + :: this is where you put the json from the home timeline in + :: make sure its in a script tag with the id jime + ;script#jime:"{(trip a)}" + ;script:"{(trip ;;(,@ .^(cx/(welp (scag 3 `path`root) /lib/urb/js))))}" + ;script:"{(trip ;;(,@ .^(%cx (welp root /main/js))))}" + == + == +++ pour + |= [way=path sih=sign] + ^- [(list move) _+>] + :_ +>.$ + %+ turn (~(tap in (~(get ju pus.hid) ~))) + |= ost=bone + [ost %give %rust %hymn (page `@t`q:(need r.p.sih))] + +++ testt + ^- hiss + [(scan "http://www.example.com" auri:epur) %get ~ ~] + +++ timl + ^- hiss + =+ (twit `keys`app-key lat.hid `@`eny.hid) + (stat-home ~ ~) + +++ posl + |= jon=json + =+ txt=`(unit ,[%tweet p=cord])`((of:jo [%tweet so:jo] ~) jon) + ~& [%posl p:(need txt)] + ^- hiss + =+ (twit `keys`app-key lat.hid `@`eny.hid) + (stat-upda ~[(st ~ p:(need txt))] ~) +-- + diff --git a/main/app/a-twit/main.css b/main/app/a-twit/main.css new file mode 100644 index 000000000..8459a2111 --- /dev/null +++ b/main/app/a-twit/main.css @@ -0,0 +1,117 @@ +body, +textarea, +input { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-weight: 400; +} + +body { + margin-top: 4rem; + font-size: 18px; +} + +input, +textarea { + font-size: 1rem; + outline: none; +} + +#c { + width: 100%; + height: 100%; +} + +#d, +#tweet, +.tweet, +.text, +textarea { + width: 32rem; +} +#d { + margin-left: auto; + margin-right: auto; +} + +textarea { + border: 0; + height: 8rem; + line-height: 1.5rem; + margin-bottom: .3rem; + resize: none; + padding: 1rem 1px; + background-color: #f7f7f7; +} + +textarea:focus { + background-color: #eee; +} + +#length, +#submit { + border: 0; + color: #333; + letter-spacing: 0.01rem; +} + +#length { + width 1rem; + height 1rem; + font-size: .6rem; + color: #ccc; + background-color: transparent; +} + +#submit { + background-color: transparent; + border: 2px solid #5DE668; + color: #5DE668; + padding: .3rem 1rem; + font-weight: 500; + cursor: pointer; +} + +#submit:hover, +#submit:focus { + background-color: #5DE668; + color: #fff; +} + +#submit.disabled { + opacity: .6; +} + +.text { + word-wrap:break-word; + margin-bottom: .3rem; + line-height: 1.6rem; +} + +#twet { + margin-bottom: 3rem; + border-bottom: 2px solid #464646; + padding-bottom: 2rem; +} + +#twet, +.tweet { + border-bottom: 1px solid #eee; +} + +.tweet { + margin-bottom: 2rem; + padding-bottom: 1rem; +} + +.author, +.date { + font-size: .8rem; + color: #ccc; + margin-right: .6rem; + display: inline-block; + margin-bottom: .3rem; +} + +.author { + color: #888; +} diff --git a/main/app/a-twit/main.js b/main/app/a-twit/main.js new file mode 100644 index 000000000..040493f48 --- /dev/null +++ b/main/app/a-twit/main.js @@ -0,0 +1,64 @@ +$(function() { + checkLength = function() { + if($tweet.val().length > 140) { + short = $tweet.val().slice(0,140) + $tweet.val(short) + return false + } + } + setLength = function() { + $("#length").val($("#tweetr").val().length+"/140") + } + + twoDig = function(d) { + return (d<10) ? "0"+d : d + } + setTime = function() { + d = new Date() + datestr = twoDig(d.getMonth()+1) + "-" + twoDig(d.getDate()) + "-" + d.getFullYear() + " " + twoDig(d.getHours()) + ":" + twoDig(d.getMinutes()) + ":" + twoDig(d.getSeconds()) + $("#twet .date").text(datestr) + } + setInterval(setTime,1000) + setTime() + + $tweet = $("#tweetr") + $time = $("#time") + $submit = $('#submit') + + $tweet.focus() + $tweet[0].selectionStart = $tweet[0].selectionEnd = $tweet.val().length + + $tweet.change(checkLength) + $tweet.keydown(checkLength) + $tweet.keyup(setLength) + + $submit.click(function() { + tweet = $tweet.val() + $tweet.attr('disabled', true) + $submit.attr('disabled', true) + $submit.addClass('disabled') + + window.urb.send({ + appl:"twit", + data:{tweet:tweet} + }, function(err,res) { + console.log(arguments) + $tweet.attr('disabled', false) + $submit.attr('disabled', false) + $submit.removeClass('disabled') + $tweet.val('') + }) + }) + + timeline = JSON.parse($('#jime')[0].innerHTML) + for(i in timeline) { + tweets = timeline[i] + d = new Date(tweets.created_at) + datestr = d.getMonth()+1 + "-" + d.getDate() + "-" + d.getFullYear() + " " + d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds() + $tweets = $("
") + $tweets.append("
@urbit_test
") + $tweets.append("
"+datestr+"
") + $tweets.append("
"+tweets.text+"
") + $time.append($tweets) + } +}) diff --git a/main/app/a-twit/twit.json b/main/app/a-twit/twit.json new file mode 100644 index 000000000..fcc1a0fb7 --- /dev/null +++ b/main/app/a-twit/twit.json @@ -0,0 +1 @@ +[{"created_at":"Wed Aug 06 22:03:43 +0000 2014","id":497140991988490240,"id_str":"497140991988490240","text":"now with more hoon","source":"\u003ca href=\"http:\/\/www.urbit.org\" rel=\"nofollow\"\u003eurbit_dev\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2485712317,"id_str":"2485712317","name":"Urbit","screen_name":"urbit_test","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3,"friends_count":1,"listed_count":0,"created_at":"Fri May 09 18:23:14 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":17,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"en"},{"created_at":"Wed May 21 19:59:09 +0000 2014","id":469205779099447296,"id_str":"469205779099447296","text":"now with more hoon","source":"\u003ca href=\"http:\/\/www.urbit.org\" rel=\"nofollow\"\u003eurbit_dev\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2485712317,"id_str":"2485712317","name":"Urbit","screen_name":"urbit_test","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3,"friends_count":1,"listed_count":0,"created_at":"Fri May 09 18:23:14 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":17,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"en"},{"created_at":"Wed May 21 00:21:24 +0000 2014","id":468909388871528449,"id_str":"468909388871528449","text":"now with more hoon","source":"\u003ca href=\"http:\/\/www.urbit.org\" rel=\"nofollow\"\u003eurbit_dev\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2485712317,"id_str":"2485712317","name":"Urbit","screen_name":"urbit_test","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3,"friends_count":1,"listed_count":0,"created_at":"Fri May 09 18:23:14 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":17,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"en"},{"created_at":"Fri May 16 22:08:05 +0000 2014","id":467426286126632960,"id_str":"467426286126632960","text":"urbit >>>> twitter","source":"\u003ca href=\"http:\/\/www.urbit.org\" rel=\"nofollow\"\u003eurbit_dev\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2485712317,"id_str":"2485712317","name":"Urbit","screen_name":"urbit_test","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3,"friends_count":1,"listed_count":0,"created_at":"Fri May 09 18:23:14 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":17,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"en"},{"created_at":"Fri May 16 20:38:00 +0000 2014","id":467403615506690048,"id_str":"467403615506690048","text":"urbit >>> twitter","source":"\u003ca href=\"http:\/\/www.urbit.org\" rel=\"nofollow\"\u003eurbit_dev\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2485712317,"id_str":"2485712317","name":"Urbit","screen_name":"urbit_test","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3,"friends_count":1,"listed_count":0,"created_at":"Fri May 09 18:23:14 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":17,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"en"},{"created_at":"Fri May 16 20:08:48 +0000 2014","id":467396266830204929,"id_str":"467396266830204929","text":"urbit >> twitter","source":"\u003ca href=\"http:\/\/www.urbit.org\" rel=\"nofollow\"\u003eurbit_dev\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2485712317,"id_str":"2485712317","name":"Urbit","screen_name":"urbit_test","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3,"friends_count":1,"listed_count":0,"created_at":"Fri May 09 18:23:14 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":17,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"en"},{"created_at":"Fri May 16 00:32:02 +0000 2014","id":467100123344826369,"id_str":"467100123344826369","text":"urbit >> twitter","source":"\u003ca href=\"http:\/\/www.urbit.org\" rel=\"nofollow\"\u003eurbit_dev\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2485712317,"id_str":"2485712317","name":"Urbit","screen_name":"urbit_test","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3,"friends_count":1,"listed_count":0,"created_at":"Fri May 09 18:23:14 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":17,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"en"},{"created_at":"Thu May 15 22:31:10 +0000 2014","id":467069706826825728,"id_str":"467069706826825728","text":"urbit > twitter","source":"\u003ca href=\"http:\/\/www.urbit.org\" rel=\"nofollow\"\u003eurbit_dev\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2485712317,"id_str":"2485712317","name":"Urbit","screen_name":"urbit_test","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3,"friends_count":1,"listed_count":0,"created_at":"Fri May 09 18:23:14 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":17,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"en"},{"created_at":"Thu May 15 21:50:31 +0000 2014","id":467059477179420672,"id_str":"467059477179420672","text":"the martians are here","source":"\u003ca href=\"http:\/\/www.urbit.org\" rel=\"nofollow\"\u003eurbit_dev\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2485712317,"id_str":"2485712317","name":"Urbit","screen_name":"urbit_test","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3,"friends_count":1,"listed_count":0,"created_at":"Fri May 09 18:23:14 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":17,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"en"},{"created_at":"Thu May 15 19:47:54 +0000 2014","id":467028618011344896,"id_str":"467028618011344896","text":"\u3044\u3089\u3063\u3057\u3083\u3044\u307e\u305b","source":"\u003ca href=\"http:\/\/www.urbit.org\" rel=\"nofollow\"\u003eurbit_dev\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2485712317,"id_str":"2485712317","name":"Urbit","screen_name":"urbit_test","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3,"friends_count":1,"listed_count":0,"created_at":"Fri May 09 18:23:14 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":17,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"ja"},{"created_at":"Thu May 15 19:46:46 +0000 2014","id":467028335324069888,"id_str":"467028335324069888","text":"%E3%81%84%E3%82%89%E3%81%A3%E3%81%97%E3%82%83%E3%81%84%E3%81%BE%E3%81%9B","source":"\u003ca href=\"http:\/\/www.urbit.org\" rel=\"nofollow\"\u003eurbit_dev\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2485712317,"id_str":"2485712317","name":"Urbit","screen_name":"urbit_test","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3,"friends_count":1,"listed_count":0,"created_at":"Fri May 09 18:23:14 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":17,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"pt"},{"created_at":"Thu May 15 19:39:33 +0000 2014","id":467026516941877248,"id_str":"467026516941877248","text":"urbit%20is%20the%20best","source":"\u003ca href=\"http:\/\/www.urbit.org\" rel=\"nofollow\"\u003eurbit_dev\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2485712317,"id_str":"2485712317","name":"Urbit","screen_name":"urbit_test","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3,"friends_count":1,"listed_count":0,"created_at":"Fri May 09 18:23:14 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":17,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"en"},{"created_at":"Thu May 15 18:47:21 +0000 2014","id":467013380121694210,"id_str":"467013380121694210","text":"@urbit_test2 right bak at you buddy","source":"\u003ca href=\"http:\/\/www.urbit.org\" rel=\"nofollow\"\u003eurbit_dev\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":466983811520012288,"in_reply_to_status_id_str":"466983811520012288","in_reply_to_user_id":2496725168,"in_reply_to_user_id_str":"2496725168","in_reply_to_screen_name":"urbit_test2","user":{"id":2485712317,"id_str":"2485712317","name":"Urbit","screen_name":"urbit_test","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3,"friends_count":1,"listed_count":0,"created_at":"Fri May 09 18:23:14 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":17,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[{"screen_name":"urbit_test2","name":"urbit test2","id":2496725168,"id_str":"2496725168","indices":[0,12]}]},"favorited":false,"retweeted":false,"lang":"en"},{"created_at":"Thu May 15 16:49:51 +0000 2014","id":466983811520012288,"id_str":"466983811520012288","text":"@urbit_test is like my best buddy","source":"\u003ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003eTwitter Web Client\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":2485712317,"in_reply_to_user_id_str":"2485712317","in_reply_to_screen_name":"urbit_test","user":{"id":2496725168,"id_str":"2496725168","name":"urbit test2","screen_name":"urbit_test2","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":1,"friends_count":1,"listed_count":0,"created_at":"Thu May 15 16:48:56 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":1,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_0_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_0_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":true,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":1,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[{"screen_name":"urbit_test","name":"Urbit","id":2485712317,"id_str":"2485712317","indices":[0,11]}]},"favorited":false,"retweeted":true,"lang":"en"},{"created_at":"Thu May 15 00:20:51 +0000 2014","id":466734919775838209,"id_str":"466734919775838209","text":"Greetings the Marzez","source":"\u003ca href=\"http:\/\/www.urbit.org\" rel=\"nofollow\"\u003eurbit_dev\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2485712317,"id_str":"2485712317","name":"Urbit","screen_name":"urbit_test","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3,"friends_count":1,"listed_count":0,"created_at":"Fri May 09 18:23:14 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":17,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"pl"},{"created_at":"Wed May 14 23:50:28 +0000 2014","id":466727275413917697,"id_str":"466727275413917697","text":"GreetingsFromMarzez","source":"\u003ca href=\"http:\/\/www.urbit.org\" rel=\"nofollow\"\u003eurbit_dev\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2485712317,"id_str":"2485712317","name":"Urbit","screen_name":"urbit_test","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3,"friends_count":1,"listed_count":0,"created_at":"Fri May 09 18:23:14 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":17,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"pl"},{"created_at":"Wed May 14 22:46:11 +0000 2014","id":466711096146268160,"id_str":"466711096146268160","text":"GreetingsFromMarz","source":"\u003ca href=\"http:\/\/www.urbit.org\" rel=\"nofollow\"\u003eurbit_dev\u003c\/a\u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":2485712317,"id_str":"2485712317","name":"Urbit","screen_name":"urbit_test","location":"","description":"","url":null,"entities":{"description":{"urls":[]}},"protected":false,"followers_count":3,"friends_count":1,"listed_count":0,"created_at":"Fri May 09 18:23:14 +0000 2014","favourites_count":0,"utc_offset":null,"time_zone":null,"geo_enabled":false,"verified":false,"statuses_count":17,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"C0DEED","profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_tile":false,"profile_image_url":"http:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_image_url_https":"https:\/\/abs.twimg.com\/sticky\/default_profile_images\/default_profile_4_normal.png","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"333333","profile_use_background_image":true,"default_profile":true,"default_profile_image":true,"following":false,"follow_request_sent":false,"notifications":false},"geo":null,"coordinates":null,"place":null,"contributors":null,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"symbols":[],"urls":[],"user_mentions":[]},"favorited":false,"retweeted":false,"lang":"de"}] \ No newline at end of file diff --git a/main/app/twit/core.hook b/main/app/twit/core.hook index 895ad13f0..4718d9cea 100644 --- a/main/app/twit/core.hook +++ b/main/app/twit/core.hook @@ -1,9 +1,8 @@ /+ twitter !: => |% - ++ rev 0 - ++ axle ,[@ @] - ++ gilt :: State data + ++ axle ,@t :: Just JSON + ++ gilt :: subscriptions frames $% [%json p=json] :: JSON format [%html p=@t] [%hymn p=manx] :: HTML format @@ -23,40 +22,52 @@ $% $: %e $% [%them p=(unit hiss)] == == == - ++ app-key :: specific keys + ++ app-key :: hardcoded keys! :- :- 'hDDOTPfGHGlsOUbhpy6qc6XbW' 'olCkea6wm3XG4pnVCHuPIozUF2ggH1sHjnBtuT4Ai6rCOeQGzO' :- '2485712317-R77Lpdu5rAJadRVxTXPpnxvcwS0IfNG7QEzLPty' 'a41d83XId0P7QQbodkPYv3zxoEL0Cq9EsN2eXZBZAwAWA' -- |_ [hid=hide vat=axle] +:: +++ prep + |= old=(unit) + ~& %hose-state + [~ +>] :: -++ root :: App root location +++ root :: internal location /(scot %p our.hid)/main/(scot %da lat.hid)/app/[app.hid] :: -++ incl :: Include scripts +++ incl :: include scripts |= wal=wall %+ turn wal |= tape ;script(type "text/javascript", src +<); -:: -++ peer :: Accept subscribes +:: +++ peer :: accept subscriber |= [ost=bone you=ship pax=path] ^- [(list move) _+>] + :_ +>.$ ?~ pax - :: [[ost %give %rust %hymn page]~ +>.$] - [[ost %pass /curl1 %e [%them (some timl)]]~ +>.$] - [~ +>.$] -:: -++ poke-json + [ost %give %rust %hymn page]~ + ?>(?=([%time ~] pax) ~) +:: +++ poke-json :: client message |= [ost=bone his=ship jon=json] ^- [(list move) _+>] - :: this is where you take the jon and post it to twitter. - ~& [%got-json jon] - [[ost %pass /curl2 %e [%them (some (posl jon))]]~ +>.$] - ::[[ost %give %nice ~]~ +>.$] + ~& [%got-json ost] + =+ jop=(need ((of [%tweet sa] [%time sa] ~):jo jon)) + ~& [%got-jop ost] + =+ key=-.jop + :_ +>.$ + :_ ~ + ?: ?=(%tweet key) + ~& [%tweet-pax /tweet/(scot %ud ost)] + [ost %pass /tweet/(scot %ud ost) %e [%them (some (posl jon))]] + ?: ?=(%time key) + [ost %give %nice ~] + !! :: ++ page - |= a=@t ^- manx ;html ;head @@ -79,34 +90,61 @@ ;div#time; == == - :: this is where you put the json from the home timeline in - :: make sure its in a script tag with the id jime - ;script#jime:"{(trip a)}" ;script:"{(trip ;;(,@ .^(cx/(welp (scag 3 `path`root) /lib/urb/js))))}" ;script:"{(trip ;;(,@ .^(%cx (welp root /main/js))))}" == == -++ pour - |= [way=path sih=sign] +:: +++ pour-time + |= [pax=path sih=sign] ^- [(list move) _+>] + ~& %pour-time :_ +>.$ - %+ turn (~(tap in (~(get ju pus.hid) ~))) - |= ost=bone - [ost %give %rust %hymn (page `@t`q:(need r.p.sih))] - + =. vat `@t`q:(need r.p.sih) + :_ =. vat `@t`q:(need r.p.sih) +>.$ + %+ turn + %+ skim (~(tap by sup.hid)) + |= [ost=bone his=ship pax=path] + ~& pax + ?=([%time ~] pax) + |= [ost=bone his=ship pax=path] + ~& [%pour-time-give + =- [ost give/rush/json/-] + (rash vat apex:poja) +:: +++ pour-tweet + |= [pax=path sih=sign] + ^- [(list move) _+>] + =+ ost=(slav %ud -.+.pax) + :_ +>.$ + :~ [ost %give %nice ~] + [ost %pass /time %e [%them (some timl)]] + == +:: +++ pour + |= [pax=path sih=sign] + ^- [(list move) _+>] + ~& [%pour pax] + ?: ?=([%time ~] pax) + (pour-time pax sih) + ?> ?=([%tweet ~] pax) + (pour-tweet pax sih) +:: ++ testt ^- hiss [(scan "http://www.example.com" auri:epur) %get ~ ~] - +:: ++ timl ^- hiss + ~& %request-timeline =+ (twit `keys`app-key lat.hid `@`eny.hid) (stat-home ~ ~) - +:: ++ posl |= jon=json + ~& [%posl jon] =+ txt=`(unit ,[%tweet p=cord])`((of:jo [%tweet so:jo] ~) jon) - ~& [%posl p:(need txt)] + ~& [%posl-txt txt] ^- hiss =+ (twit `keys`app-key lat.hid `@`eny.hid) (stat-upda ~[(st ~ p:(need txt))] ~) diff --git a/main/app/twit/main.js b/main/app/twit/main.js index 040493f48..b64e985b1 100644 --- a/main/app/twit/main.js +++ b/main/app/twit/main.js @@ -50,15 +50,30 @@ $(function() { }) }) - timeline = JSON.parse($('#jime')[0].innerHTML) - for(i in timeline) { - tweets = timeline[i] - d = new Date(tweets.created_at) - datestr = d.getMonth()+1 + "-" + d.getDate() + "-" + d.getFullYear() + " " + d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds() - $tweets = $("
") - $tweets.append("
@urbit_test
") - $tweets.append("
"+datestr+"
") - $tweets.append("
"+tweets.text+"
") - $time.append($tweets) + render = function(timeline) { + for(i in timeline) { + tweets = timeline[i] + d = new Date(tweets.created_at) + datestr = d.getMonth()+1 + "-" + d.getDate() + "-" + d.getFullYear() + " " + d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds() + $tweets = $("
") + $tweets.append("
@urbit_test
") + $tweets.append("
"+datestr+"
") + $tweets.append("
"+tweets.text+"
") + $time.append($tweets) + } + } + + window.urb.subscribe({ + appl:"twit", + path:"/time" + }, function(err,res) { + console.log('subscr') + console.log(arguments) + }) + + try { + timeline = JSON.parse($('#jime')[0].innerHTML) + render(timeline) + } catch (e) { } })