我意识到这不是什么新鲜事,并且已经有很多关于这个主题的帖子.然而,非与我正在寻找的东西完全相关......所以,它在这里:
我已经回顾了关于这个主题的其他帖子,似乎没有什么对我有用.以下是我正在做的事情的快速摘要:
***我已经这么久了,以至于我忘记了我的位置 - 我刚刚意识到我的oauth_signature现在在我的授权标题中丢失了.我知道它之前有...
顺便说一句 - 我正在使用Harry Klein的CF oauth应用程序(http://oauth.riaforge.org/):
<!--- set up the parameters --->
<cfset sConsumerKey = 'xxx'> <!--- Got these from Tumblr for my app --->
<cfset sConsumerSecret = 'xxx'> <!--- Got these from Tumblr for my app --->
<cfset OAUTH_VERIFIER = 'xxx' /> <!--- Got these when doing oauth registration with tumblr for account --->
<cfset token = 'xxx' /> <!--- Got these when doing oauth registration with tumblr for account --->
<cfset tokenSecret …
Run Code Online (Sandbox Code Playgroud) 我希望我的服务具有这样的功能:作者可以完全自定义页面,但不能窃取用户的cookie.
Tumblr遇到了一些麻烦,但成功解决了这些问题http://www.riyazwalikar.com/2012/07/stored-persistent-xss-on-tumblr.html
所以我需要解决方案
据我了解tumblr:
我可以为用户提供安全舒适的解决方案吗?cookie-theft是完全访问html的主要问题吗?
我需要将图像发布到Tumblr.我读了这篇http://www.tumblr.com/docs/en/api/v2#auth,我知道我需要获取用户信息才能获得博客名称.我使用了与Twitter验证相同的代码,更改了URL并成功加载了Tumblr webview.我使用以下代码进行身份验证并获取用户信息.
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.StatusLine;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.twitter.imageupload.R;
import com.twitter.imageupload.SecondClass;
import com.twitter.imageupload.TwitterImageUpload;
import oauth.signpost.OAuth;
import oauth.signpost.OAuthConsumer;
import oauth.signpost.OAuthProvider;
import oauth.signpost.commonshttp.CommonsHttpOAuthConsumer;
import oauth.signpost.commonshttp.CommonsHttpOAuthProvider;
import oauth.signpost.http.HttpParameters;
import twitter4j.conf.Configuration;
import twitter4j.conf.ConfigurationBuilder;
import twitter4j.http.AccessToken;
import twitter4j.http.OAuthAuthorization;
import android.app.Activity; …
Run Code Online (Sandbox Code Playgroud) 来自tumblr的新代码{LikeButton}
提供了很少的选项:颜色和大小.
它注入一个iFrame,它处理"Like"功能并提供SVG图形.
但是,由于iframe和跨站点脚本策略,不再可以使用css更改它,也不再编辑其内容.
如何修改或插入新代码,以使用我自己的Like按钮sprite或svgs?
我正在编写一个应用程序,必须获得PHP中Tumblr帖子的喜欢数量.我正在使用Tumblr PHP库并已成功通过身份验证.我Client::getBlogPosts()
用来获取帖子列表.它返回的本质上是一个PHP数组,其信息如下:
{
"blog_name": "jeteon",
"id": 92729317211,
"post_url": "http://jeteon.tumblr.com/post/92729317211/where-to-find-libxm-so-2-for-ubuntu",
"slug": "where-to-find-libxm-so-2-for-ubuntu",
"type": "link",
"date": "2014-07-24 13:43:04 GMT",
"timestamp": 1406209384,
"state": "published",
"format": "html",
"reblog_key": "oA2WcGac",
"tags": [
"dakota",
"ubuntu"
],
"short_url": "http://tmblr.co/Z9ROeu1MN6HTR",
"highlighted": [],
"note_count": 0,
"title": "Where to find libXm.so.2 for Ubuntu",
"url": "https://packages.debian.org/wheezy/lesstif2",
"author": null,
"excerpt": null,
"publisher": "packages.debian.org",
"description": "<p>I recently had to install Dakota (<a href=\"http://dakota.sandia.gov\">http://dakota.sandia.gov</a>) and after considerable trouble with prerequisites, found that the binary install on Ubuntu requires (amonst other …
Run Code Online (Sandbox Code Playgroud) tl; dr: tumblr更改了markdown和HTML代码.如果你写入<
降价代码并重新加载它,它将被替换为<
破坏事物.如果您使用HTML编辑器并放置类似于&
mathjax可能需要的东西,它将被替换为&
并最终破坏您的表/矩阵.
如何避免这种情况?
我开始使用tumblr而且我补充说
<!-- Syntax highlighting -->
<link rel="stylesheet" href="http://yandex.st/highlightjs/7.2/styles/default.min.css">
<script src="http://yandex.st/highlightjs/7.2/highlight.min.js">
</script>
<script>
hljs.initHighlightingOnLoad();
</script>
<!-- Mathjax LaTeX Mode -->
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
Run Code Online (Sandbox Code Playgroud)
能够使用Mathjax和highlightjs.但问题是,如果我使用tumblr的HTML编辑器并输入:
$$
\left[
\begin{array}{cc|c}
1 & 2 & 3<br>
4 & 5 & 6
\end{array}
\right]
$$
</p><pre><code>public class Main {
public static void main(String[] args) {
System.out.println(”Hello World!”);
}
}
</code></pre></p>
Run Code Online (Sandbox Code Playgroud)
tumblr将始终替换不起作用的&
with &
并导致矩阵呈现不像我预期的那样:
是否有可能让语法高亮和mathjax工作?
另一个问题似乎是:
$$
\begin{bmatrix}a & b \\\\\ c …
Run Code Online (Sandbox Code Playgroud) 似乎{PreviousPost}和{NextPost}无法在Tumblr上创建自定义主题.这是我的代码.有人能指出我的错误......
<div>
{block:PreviousPost}<a href="{PreviousPost}"><span>Previous Post</span></a>{/block:PreviousPost}
{block:NextPost}<a href="{NextPost}"><span>Next Post</span></a>{/block:NextPost}
</div>
Run Code Online (Sandbox Code Playgroud) 我刚刚用一个全新的Wordpress网站替换了一个tumblr网站.当通过Facebook调试器运行它时,我收到此错误:
" http://example.com/ "上的对象之前的类型为"tumblr-feed:tumblelog",无法更改为"网站"类型的对象,以避免现有操作的数据损坏.
我用Google搜索"不能改变og_type"(引号)并得到字面上为零的结果(现在似乎有这个问题的结果).我真的注定了Facebook数据不匹配吗?
精简版:
有没有办法,使用Grunt,包括缩小的CSS和JavaScript内联?
以usemin的格式为例,我想看到这样的东西:
<!-- build:css inline -->
<link rel="stylesheet" href="styles/foo.css">
<link rel="stylesheet" href="styles/bar.css">
...
<!-- endbuild -->
<!-- build:js inline -->
<script src="js/foo.js"></script>
<script src="js/bar.js"></script>
...
<!-- endbuild -->
Run Code Online (Sandbox Code Playgroud)
变成这样的事情:
<style>body { color: red; } /*css is here*/</style>
<script>var foo = 1; bar = 'some javascript code is here'; ...</script>
Run Code Online (Sandbox Code Playgroud)
长版:
所以,我正在研究Tumblr主题.为了在主题中使用CSS或JS文件,必须将它们上传到Tumblr.上传的唯一方法是经常崩溃的糟糕的小网页形式.我正试图避免这个界面,直到我准备上传最终代码,因为
为了得到这个,我一直在复制我的CSS和JS到<style>
和<script>
标签我的文件,然后复制整个事情到的Tumblr主题编辑器.它更快,所以我很高兴,但手动复制和粘贴CSS和JS到文件似乎违背了Grunt的精神和它提供的自动化.
理想情况下,我可以运行grunt build
并使用CSS和JS内联吐出一个html文件,然后我可以将其复制到Tumblr接口中(好吧,理想情况下,我可以将该HTML文件复制到Tumblr,但Tumblr不提供FTP或SSH或任何有用的接口,所以我会满足于此.
它似乎grunt-usemin
可以提供我正在寻找的功能,但我无法按照我的描述使其正常工作.也许它只是将所有内容放入一个单独的文件中.
我愿意使用任何Grunt工具,如果有人知道可以实现这一点.
我正在尝试在Yii2中使用Auth Client Extension(http://www.yiiframework.com/doc-2.0/ext-authclient-index.html).我复制了YiiFramework附带的Twitter Auth Client类,并制作了自己的Tumblr版本.Twitter工作正常,但是当我使用我的Tumblr版本时,我在屏幕上显示"此应用程序访问您的某些数据并将帖子发布到您的帐户之后是否正常?"您已登录为*********".(Tumblr oauth页面)
出现错误:请求失败,代码为:401,消息:oauth_signature与预期值不匹配
这是我的Tumblr auth客户端代码:
namespace yii\authclient\clients;
use yii\authclient\OAuth1;
/**
*
* Example application configuration:
*
* ~~~
* 'components' => [
* 'authClientCollection' => [
* 'class' => 'yii\authclient\Collection',
* 'clients' => [
* 'tumblr' => [
* 'class' => 'yii\authclient\clients\Tumblr',
* 'consumerKey' => 'tumblr_consumer_key',
* 'consumerSecret' => 'tumblr_consumer_secret',
* ],
* ],
* ]
* ...
* ]
* ~~~
*
*/
class Tumblr extends OAuth1
{
/**
* @inheritdoc
*/
public …
Run Code Online (Sandbox Code Playgroud)