我已经研究过,我得出结论,Facebook Graph API限制是每个访问令牌每600秒600个请求.
由于我只使用新的Graph API,因此我从未遇到过手动传递访问令牌的需要.我相信需要传递旧的REST API.它应该意味着,对于我的应用程序的每个不同用户,我有一个不同的访问令牌,我的API限制在接下来的600秒被重置.谁能确认一下?
如果我使用offline_access权限怎么办?我读到某个地方,使用offline_access权限,访问令牌永远不会改变,因此您可以随时访问数据.真正?然后在这种情况下,我只有600个请求/ 600秒的速率用于此访问令牌.正确?
我正在构建一个我认为会传播病毒的应用程序,因此我尝试不要阻止我的API使用.在访问时(它完全适用于AJAX),我每个用户使用10-15个查询,所以考虑到速率,我远低于我可以使用FB API的速率?
总的来说,我的应用程序可能有一百万用户,让我可以同时为每个用户的访问令牌做600个请求/ 600秒.
有人可以评论吗?
我已经在magento中实现了头部的打孔,即使我已经按照每个客户的方式进行了工作,我也需要通过使其在diff cart项目计数上工作来更深入地使用这一级别.
这是我的代码.
class AD_PageCache_Model_Container_Header extends Enterprise_PageCache_Model_Container_Abstract {
protected function _getIdentifier() {
return $this->_getCookieValue(Enterprise_PageCache_Model_Cookie::COOKIE_CUSTOMER, '');
}
// public function getCacheKeyInfo() {
// $info = parent::getCacheKeyInfo();
// die('boo');
// $info['cart_count'] = Mage::helper( 'checkout/cart' )->getCart()->getItemsCount();
// return $info;
// }
protected function _getCacheId() {
//return 'CONTAINER_HEADER_' . md5($this->_placeholder->getAttribute('cache_id') . $this->_placeholder->getAttribute('cart_count') ) . '_' . $this->_getIdentifier();
return 'CONTAINER_HEADER_' . md5( $this->_placeholder->getAttribute('cache_id') . $this->_getIdentifier() );
}
protected function _renderBlock() {
$blockClass = $this->_placeholder->getAttribute('block');
$template = $this->_placeholder->getAttribute('template');
$block = new $blockClass;
$block->setTemplate($template);
return $block->toHtml();
} …Run Code Online (Sandbox Code Playgroud) 我已经阅读了这个问题,但对于Discover卡,起始数字6011, 622126-622925, 644-649, 65不仅仅是6011, 65.(来源)
对于Discover卡,我从这个问题中选择了这个正则表达式 ^6(?:011|5[0-9]{2})[0-9]{12}$
我修改它来掩盖6011,644-649&65但是622126-622925,建筑的正则表达式是很难的Cuz我可怜的正则表达式的技能.
到目前为止我有这个正则表达式6(?:011|5[0-9]{2}|[4][4-9][0-9]|[2]{2}[1-9])[0-9]{2}$,但它只检查622[1-9]**.
如何修改它,使它只接受之间622126-622925的622***情况?
我试图通过XML在magento管理员的仪表板页面上加载一个js文件,但我无法做到正确.
这是我在配置文件中添加的代码部分:
<config>
<adminhtml>
<layout>
<updates>
<anattadesign_abandonedcarts>
<file>my_extension.xml</file>
</anattadesign_abandonedcarts>
</updates>
</layout>
</adminhtml>
</config>
Run Code Online (Sandbox Code Playgroud)
而我的内容my_extension.xml被划归/app/design/adminhtml/default/default/layout/为:
<layout>
<default>
<reference name="head">
<action method="addJs"><script>my_extension/adminhack.js</script></action>
<action method="addJs"><script>prototype/prototype.js</script></action>
</reference>
</default>
</layout>
Run Code Online (Sandbox Code Playgroud)
我知道我正在尝试以这种方式为整个管理员加载一个js文件,但我想知道两者,在某个页面上加载,以及如果我想在某个页面上加载它,如何找到该名称if default是否正确加载所有管理页面.
我已经好几次遇到过这种情况,而且没有任何解释.网站上没有JS错误.代码确实正在执行.用它们取代它们alert()就可以了.
所以今天又发生了,所以我试着检查控制台对象中的控制台对象,我发现了一些不规则的事情,好像有什么东西覆盖了控制台对象.
以下屏幕截图是我遇到此问题的网站(网站A):
http://ompldr.org/vZ256Mw/Selection_004.jpg
你看到log,warn和info是空函数吗?控制台对象与控制台工作正常的网站(站点B)的不同之处(截图如下)?
http://ompldr.org/vZ256Mg/Selection_003.jpg
现在,在两个站点上运行的代码完全相同.站点B是我的本地安装,站点A正在升级,我在代码中没有任何东西覆盖控制台对象,那么这个行为有什么解释呢?
根据nfroidure的建议,我在其他任何内容之前添加了代码,我得到了这个:uncaught error! (anonymous function) (anonymous function)第二个指向另一个库文件中的代码,其中包含以下内容:
if (!("console" in window) || !("firebug" in console))
{
var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
"group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
window.console = {};
for (var i = 0; i < names.length; ++i)
window.console[names[i]] = function() {}
}
Run Code Online (Sandbox Code Playgroud)
这是负责任的,因为我认为if检查是错误的."console" in window将是真的,"firebug" in window在Chrome中对我来说是错误的,导致替换控制台方法.它应该&&在那边,不是吗?
更新:更改操作员后,&&它开始在站点A上工作,但我不明白为什么它只在一个而不是另一个上被触发.
我的svn回购中的作者如下:
$ svn log --xml | grep作者| sort -u | perl -pe's /.>(.?)<./$ 1 = /'
输出:
<author>ashfame</author>
<author>clean</author>
<author>clean </author>
<author>rocketweb</author>
Run Code Online (Sandbox Code Playgroud)
但是在使用进口克隆回购的时候git svn clone,它却在说到之间停了下来Author: clean not defined in /home/ashfame/fun/authors-transform.txt file
注意clean之后的双倍空格,这意味着它是第三个用户"clean ".
如何格式化我的作者文件以在用户名中留出空格?我目前的内容如下:
ashfame = Ashfame <mail@example.com>
clean = Yogesh Tiwari <yogesh.tiwari@example.com>
clean = Yogesh Tiwari <yogesh.tiwari@example.com>
"clean\ " = Yogesh Tiwari <yogesh.tiwari@example.com>
"clean " = Yogesh Tiwari <yogesh.tiwari@example.com>
rocketweb = rocketweb <rocketweb@rocketweb.com>
(no author) = Yogesh Tiwari <yogesh.tiwari@example.com>
(no author) = no_author …Run Code Online (Sandbox Code Playgroud) 无论如何,在解析和组合所有不同的XML文件之后,检查最终的XML结构magento?
我知道通过执行以下操作来指定 HTTP 请求超时的常用方法:
httpClient := http.Client{
Timeout: time.Duration(5 * time.Second),
}
Run Code Online (Sandbox Code Playgroud)
但是,我似乎无法弄清楚在跟踪 HTTP 请求时如何做同样的事情。这是我正在使用的一段代码:
func timeGet(url string) (httpTimingBreakDown, error) {
req, _ := http.NewRequest("GET", url, nil)
var start, connect, dns, tlsHandshake time.Time
var timingData httpTimingBreakDown
timingData.url = url
trace := &httptrace.ClientTrace{
TLSHandshakeStart: func() { tlsHandshake = time.Now() },
TLSHandshakeDone: func(cs tls.ConnectionState, err error) { timingData.tls = time.Since(tlsHandshake) },
}
req = req.WithContext(httptrace.WithClientTrace(req.Context(), trace))
start = time.Now()
http.DefaultTransport.(*http.Transport).ResponseHeaderTimeout = time.Second * 10 // hacky way, worked earlier but don't work anymore …Run Code Online (Sandbox Code Playgroud) 我在推特上看到了这个,我也无法解释.onload以下两种方式定义函数有效:
<html>
<head>
<script>
onload = function(){
alert('this works');
};
</script>
</head>
<body>
</body>
</html>?
Run Code Online (Sandbox Code Playgroud)
<html>
<head>
<script>
window.onload = function(){
alert('this works');
};
</script>
</head>
<body>
</body>
</html>?
Run Code Online (Sandbox Code Playgroud)
但是,如果定义如下,即使分配给它也不起作用 window.onload
<html>
<head>
<script>
function onload(){
alert('this doesnt work');
};
alert(window.onload); // this shows the definition of above function
</script>
</head>
<body>
</body>
</html>?
Run Code Online (Sandbox Code Playgroud)
这里发生了什么?
我想2 of 10在我的滑块上显示幻灯片计数.如何使其与过渡工作3 of 10,4 of 10(如幻灯片滑块移动)7 of 10(如果相应的缩略图是点击)?
我正在尝试解决我的块的输出是空字符串的问题.
我将其追溯到我可以看到在模板文件中评估PHP语句的程度,但在toHtml()类内部Mage_Core_Block_Abstract,$html = $this->_toHtml();将空字符串赋值给$html.
我进一步挖掘它,并发现在里面fetchView(),$html = ob_get_clean();给它分配空字符串,即使模板被包含在这一行之上,我也可以看到它使用调试器进行评估.
从这里我对如何调试这一点毫无头绪,可能是我在模块中遗漏了一些错误(我是Magento的初学者).
以下是该模块的相关代码:
应用程序/代码/本地/ AnattaDesign/AbandonedCarts的/ etc/config.xml中
<config>
<global>
<blocks>
<anattadesign_abandonedcarts>
<class>AnattaDesign_AbandonedCarts_Block</class>
</anattadesign_abandonedcarts>
</blocks>
</global>
<adminhtml>
<layout>
<updates>
<anattadesign_abandonedcarts>
<file>layout.xml</file>
</anattadesign_abandonedcarts>
</updates>
</layout>
</adminhtml>
Run Code Online (Sandbox Code Playgroud)
应用程序/设计/ adminhtml /碱/默认/布局/ layout.xml
<?xml version="1.0" encoding="utf-8"?>
<layout>
<adminhtml_dashboard_index>
<reference name="head">
<action method="addCss">
<stylesheet>anattadesign/abandonedcarts/css/style.css</stylesheet>
</action>
<action method="addJs">
<script>anattadesign/abandonedcarts/zepto.js</script>
</action>
<action method="addJs">
<script>anattadesign/abandonedcarts/adminhack.js</script>
</action>
</reference>
</adminhtml_dashboard_index>
</layout>
Run Code Online (Sandbox Code Playgroud)
应用程序/代码/本地/ AnattaDesign/AbandonedCarts /控制器/ WidgetController.php
<?php
class AnattaDesign_AbandonedCarts_WidgetController extends Mage_Adminhtml_Controller_Action {
public function indexAction() …Run Code Online (Sandbox Code Playgroud) 我需要在焦点上运行一些代码,并在页面加载后注入到DOM中的元素上模糊事件.所以我使用Zepto on(链接上的Zepto)来运行代码,但它对我不起作用.
这是我的jsfiddle,我试图让它工作 - http://jsfiddle.net/ashfame/zR2xL/
magento ×4
javascript ×3
facebook ×1
git-svn ×1
go ×1
http ×1
jquery ×1
nivo-slider ×1
regex ×1
zepto ×1