物理仪表板/状态板的库和伪代码

发布于 2024-09-05 02:04:37 字数 1578 浏览 11 评论 0原文

好的,所以我昨天为办公室买了一个 46 英寸的屏幕,并且面临着被指控制定“精心设计的世界杯拖延计划”的迫在眉睫的风险,我最好向我的同事展示它的用途;)

看看我的简单的草图,在这些很棒 项目,我从中受到启发,我想获得以下方面的一些意见:

  1. < p>框架的伪代码:由于某些方法应每 24 小时调用一次(“标题中的今天日期”),其他方法应每隔 60 秒调用一次(“Twitter 结果”),所以什么是好的使用 JavaScript (jQuery) 和 PHP 的方法?

    编辑:Alciende:我同意 #1 和 #8 太模糊了。因此,我删除了 #8 并尝试澄清 #1:对于“骨架的伪代码”,我基本上的意思是这可以完全使用 JavaScript 计时器来完成吗?您将如何设置各种计时器?

  2. Google Analytics 库:哪些库支持 Google Analytics API 并且可以生成简洁的图表。最好是 HTML5,基于 JavaScript,例如 Protovis

  3. Twitter 库:您会推荐哪些库来从个人资料中获取 Twitter 搜索结果和最新推文。

  4. 排版/CSS/HTML5 库:在此过程中尝试学习一些 HTML5 等,请就任何其他可能相关的排版/CSS 库提供建议。

  5. 抓取/解析?我会给你一个具体的例子:尝试从 这家餐厅的网站,您会如何访问? (它是瑞典语 - 但你明白了 - 抱歉;))

  6. 实时统计数据? 我正在使用 WordPress 的 WassUp 插件来跟踪我们网站上的实时访问者。其他日志记录软件(AWStats 等)可能也安装在网络服务器上。关于如何从中提取信息并在仪表板上实时呈现的任何想法?

  7. 浏览器选择?您会选择哪种浏览器和操作系统?稳定、全屏、HTML5。

替代文本 http://www.freeimagehosting.net/uploads/cb7af2ef28.png

OK, so I bought a 46" screen for the office yesterday, and with the imminent risk of being accused for setting up an "elaborate World Cup procrastination scheme", I'd better show my colleagues what it's meant for ;)

Looking at my simple sketch, and at these great projects from which I was inspired, I would like to get some input on the following:

  1. Pseudocode for the skeleton: As some methods should be called every 24 hours ("Today's date in the heading"), others at 60 second intervals ("Twitter results"), what would be a good approach using JavaScript (jQuery) and PHP?

    EDIT: Alsciende: I can agree that #1 and #8 are too vague. Therefore I remove #8 and try to clarify #1: With "Pseudocode for the skeleton", I basically mean could this be done entirely using JavaScript timers and how would you set up the various timers?

  2. Library for Google Analytics: Which libraries support the Google Analytics API and can produce neat charts. Preferably HTML5, JavaScript-based like Protovis.

  3. Library for Twitter: Which libraries would you recommend for fetching twitter search results and latest tweets from profiles.

  4. Libraries for Typography/CSS/HTML5: Trying to learn some HTML5 etc. in the process, please advice on any other typography/css libraries that could be of relevance.

  5. Scraping/Parsing? I'll give you a concrete example: Trying to fetch today's menu from this restaurant's website, how would you go about? (it's in Swedish - but you get the point - sorry ;) )

  6. Real-time stats? I'm using the WassUp-plugin for WordPress to track real-time visitors on our website. Other logging software (AWStats etc.) is probably also installed on the webserver. Any ideas on how to extract information from these and present in real-time on the dashboard?

  7. Browser choice? Which Browser and OS would you pick? Stable, Full-screen, HTML5.

alt text http://www.freeimagehosting.net/uploads/cb7af2ef28.png

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

沉默的熊 2024-09-12 02:04:38

我已经为我们的办公室构建了一个类似于您所说的仪表板。我花了大约一天的时间来研究它,可能性真的(几乎)是无穷无尽的。基本上,我通过 PHP 处理所有计算内容,并对适当的 PHP 脚本进行间隔 AJAX 调用,该脚本返回要呈现的 JSON 数据。

#2:
对于图表,我使用/推荐 flot (http://code.google.com/p/flot/ )。该文档并不是真的那么好,但是一旦您弄清楚事情通常是如何工作的 - 它是一个很棒的库,并且它使用 HTML5 Canvas 标签生成图表。

我之前没有将外部库与 Google Analytics 集成,但我假设您可以从分析中提取数据并将其格式化以用于构建适当的图表。这可能是一个困难的方法,但我比大多数其他图形库更熟悉 flot (而且它并不像许多其他图形库那样糟糕),所以对我来说,这将是最简单的方法完成它。

#3:
对于 Twitter,使用 JSON-P 从其搜索 API 中提取数据非常容易。基本上,它的作用是动态地将

#5:
抓取和解析各个站点将是一个艰苦的过程。每个网站都会有自己的“模式”(或非模式)来发布其每日菜单或特价菜。我会构建一个“菜单”脚本,它知道如何调用一些函数,并编写一个函数/类来抓取您有兴趣用 PHP(或您喜欢的任何其他语言)显示菜单的每个餐厅的网站和)。它可以用 json 进行回复,这是 (imo) 在 Javascript 中操作/处理数据的最简单方法。

#6:
实时统计数据与#5 几乎相同。我将构建几个类,它们知道如何从我感兴趣的任何数据源中获取统计信息,并通过 ajax 调用将数据以 json 形式呈现给 javascript。

#1: 编写 javascript 代码来在计时器上加载数据非常简单,查看 setIntervalclearIntervalsetTimeout code> 和clearTimeout 方法。它们都需要一个函数名称(或闭包)和调用该函数之前等待的超时时间(以毫秒为单位)。您可以轻松地每 60 秒调用一次主计时器函数,该函数基本上是一个“调度程序”或“cron”样式函数,它只会查找“立即”运行所需的内容并从调度程序执行这些函数。

希望这能为您提供一些关于去哪里以及如何到达那里的想法。

I've built a dashboard similar to what you're talking about for our office. I spent about a day working on it, the possibilities are really (pretty much) endless. Basically, all the computational stuff I handle via PHP and do interval AJAX calls to the appropriate PHP script, which returns JSON data to present.

#2:
For graphs, I use/recommend flot (http://code.google.com/p/flot/). The documentation isn't really that great, but once you figure out how things generally work - it's a great library, and it generates graphs using HTML5 Canvas tag.

I've not integrated external libraries with Google Analytics before, but I assume you could pull data from analytics and format it for flot to build appropriate graphs for. This might be the hard-way around, but I'm more familiar with flot than most other graphing libraries (and it doesn't suck, as much as a lot of others do) so for me, this would be the easiest way to get it done.

#3:
For twitter, it's pretty easy to pull data from their search API using JSON-P. Basically what this does, is dynamically adds a <script> tag to your DOM, which GET parameters that twitter interprets, then calls a predefined javascript method (which you pass via the URI) with a json-encoded hash of the results.

#5:
Scraping and parsing individual sites is going to be a painstaking process. Every site is going to have it's own "pattern" (or non-pattern) for publishing their daily menu or specials. I'd build a "menu" script which knew how to call a few functions, and write a function / class for scraping each restaurant's site which you're interested in showing the menu for in PHP (or whatever other language you're comfortable with). It can reply with json, which is (imo) the easiest way to manipulate/process data in Javascript.

#6:
Real time stats are pretty much the same as #5. I'd build a couple classes that knew how to fetch the statistics from whatever data sources I was interested in pulling from, and present the data in json to javascript, via an ajax call.

#1: Writing javascript code to load data on a timer is really simple, look into the setInterval, clearInterval, setTimeout, and clearTimeout methods. They all take a function name (or closure) and a timeout to wait before calling that function (in ms). You could easily call a master timer function every 60 seconds which would basically be a "scheduler" or a "cron" style function, which would just look for the stuff that needed to run "right now" and execute those functions from the scheduler.

Hopefully this gives you some ideas on where to go, and how to go about getting there.

梦魇绽荼蘼 2024-09-12 02:04:38

对于 Rails Rumble,我们开发了 Boarrd,这正是您想要开发的!

Panic 也给我们留下了深刻的印象 :)

RailsRumble 的团队页面中,您会找到有关所用工具的详细信息。我知道 PHP 中没有,但也许您会尝试我们的工具并决定更好的开发环境;)

For the Rails Rumble we developed Boarrd that is exactly what you would like to develop!

We were impressed by Panic too :)

In our team page on RailsRumble you'll find details about the tools used. I know that is not in PHP but maybe you'll try our tool and decide for better development environment ;)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文